Many bacteria exploit motility to explore favourable environments for growth, but they occasionally encounter highly viscous regions e.g., mucosa covering host tissues. How do bacteria address this elevation in viscosity? Is the viscous effect beneficial or disadvantageous? Here we focus on the motility of the spirochete Leptospira where we find that an increase in viscosity induces a high frequency of swimming reversal. Computer simulation also demonstrates that enhanced swimming reversal limits cell dissemination, promoting accumulation of the spirochete in highly viscos regions. These findings suggest that motility is an effective strategy used by spirochetes for colonization, nutrition, and infection.