I just enjoy it then get back on track and try to think of how much worse things could be. I think of it like I exercise and eat healthy so I can eat donuts and not look like I eat donuts.
Besides that, ppl recommend smaller treats during the week, so you're not completely depriving yourself. I find it really difficult to control myself once I eat a little junk, though.
Eat enough. And allow yourself to have some 'bad stuff' every once a while.
I personally like chocolate. So I still eat it almost everyday. I just control my portions. This way I still feel like I can eat whatever I like. But I control my energy intake. Which is always most important.