I've had an eye opener like that, that ended a successful loosing spree. Yes, it made me feel all bloated, and crappy, and the worse i felt, the more I ate. You're lucky to quickly see the error of your ways before it's too late.
I have devised a little emergency plan for situations like this. I do know that I don't want to go backwards, and I want to get this poundage OFF now, so motivation alone helps tremendously but my plan for emergency (or spur of the moment excursions) includes a small cooler, several ice packs, an extra bottle of low-fat salad dressing, plenty of grab and go fruit, veggies, yogurt, cans of V8 etc. oh hand... I make it a point to never run out of my basic needs. In a spur of the moment, I can throw a few days worth of food in my cooler, and still plan on a few nice meals out.
Though of course if you go into it planning on blowing it...well nothing is going to help. You either pay for it later, or give up.
Good job for getting back on the wagon. You've gone a long way and almost 1/2 way to your goal. It would be a shame to stop being healthy now.