Iif you've had more treats than you should (like fudge) - enjoy having it and then move on, try not to let it affect your motivation for your overall goal.
I used to have a bad day and then think "blow it" and go the whole hog but now I just say "well, I enjoyed that meal/night out etc but...