Cyclic weight loss and subsequent regain after dieting and non-dieting periods, a phenomenon termed yoyo dieting, places individuals at greater risk of metabolic complications and alters gut microbiome composition. Resistant starch (RS) improves gut health and systemic metabolism. This study aimed to investigate the effect of yoyo dieting and RS on the metabolism and gut microbiome. C57BL/6 mice were assigned to 6 diets for 20 weeks, including control, high fat (HF), yoyo (alternating HF and control diets every 5 weeks), control with RS, HF with RS, and yoyo with RS. Metabolic outcomes and microbiota profiling using 16S rRNA sequencing were examined. Yoyo dieting resulted in short-term weight loss, which led to improved liver health and insulin tolerance but also a greater rate of weight gain compared to continuous HF feeding, as well as a different microbiota profile that was in an intermediate configuration between the control and HF states. Mice fed HF and yoyo diets supplemented with RS gained less weight than those fed without RS. RS supplementation in yoyo mice appeared to shift the gut microbiota composition closer to the control state. In conclusion, yoyo dieting leads to obesity relapse, and increased RS intake reduces weight gain and might help prevent rapid weight regain via gut microbiome restoration.