Congratulations on listening to your body. I also lost a ton of weight when I went low-carb, that came back after leaving that program. And again with a doctor guided diet for food allergies. The key seems to be not so much what you eat (as long as it meets your nutritional needs), as mindful eating choices, and no mindless snacking. Then, when you eat something and experience a poor reaction to it, that's information. Your body doesn't want you to eat that. You end up working with your body, instead of being in an adversarial relationship with it. That's more sustainable over the long run.