One of my favorite quotes from a SparkPeople member is this:
"If you broke one traffice law, would you go through the rest of the day breaking every traffic law you could - just because you screwed up earlier?" Indy-Girl
Check out her daily spark blog posting, for more very helpful insight: www.dailyspark.com/blog.asp?post=tips_how_
Another thing that I find helpful, is that when I notice I've done something that isn't in tune with my goals, I try to immediately take two steps towards being healthy (drink a glass of water and take a ten minute walk, for two examples). This can stop a downward spiral in its tracks. SparkPeople calls it the "One step backwards, two steps forward" plan, and it works very well for me. Here is a link to that article: www.sparkpeople.com/resource/motivation_ar
Like every other change you are trying to make, this may take some time for your mind to adjust it's thinking. Don't beat up on yourself. We have all done this, and know exactly where you are. You aren't alone.