Microbiome recovery after antibiotic-induced dysbiosis is often unpredictable, and the ecological mechanisms governing successful gut microbiome restoration remain unclear. Here we introduce a novel dynamical model of bacteria-phage-pathogen interactions to examine how gut virome reshapes gut microbiome states. The model identifies pathogen eradication thresholds and shows that recovery is strongly history-dependent, with bistability allowing either clearance or persistence depending on past conditions. Viral adsorption rates strongly regulate invasion probability and recurrence susceptibility, while microbial diversity enhances stability. Furthermore, we identify an ecological “firewall” mechanism in which the resident microbiome maintains a standing virome community that suppresses pathogen invasion and stabilizes healthy microbiome. These results reveal general ecological principles governing virus-mediated microbiome recovery and inform the design of virome-based therapeutic strategies.