Microbial adaptation to changing environmental conditions is frequently mediated by hypermutable sequences. Here we demonstrate that such a hypermutable hotspot within a gene encoding a flagellar unit of Paenibacillus glucanolyticus generated spontaneous non-swarming mutants with increased stress resistance. These mutants, which survived conditions that eliminated wild-type cultures, could be carried by their swarming siblings when the colony spread, consequently increasing their numbers at the spreading edge. Of interest, the hypermutable nature of the aforementioned sequence enabled the non-swarming mutants to serve as "seeds" for a new generation of wild-type cells through reversion of the mutation. Using a mathematical model, we examined the survival dynamics of P.glucanolyticus colonies under fluctuating environments. Our experimental and theoretical results suggest that the non-swarming, stress-resistant mutants can save the colony from extinction. Notably, we identified this hypermutable sequence in flagellar genes of additional Paenibacillus species, suggesting that this phenomenon could be wide-spread and ecologically important.