This is completely on you, literally! Let's say for fat loss, you maintained a good diet and you were eating in a caloric deficit with some exercise. You lost weight, hit your goal. Post this, if you start binging and eating a lot of caloric dense food, you are going to be in a caloric surplus. Remove the exercise, the surplus grows further. The excess energy is bound to be stored as fat.
But, what you can do instead is be at your maintenance calories (no gain/no loss), incorporate occasional eating of your favorite foods and exercise. Make good choices 80-85% of the times and you can maintain or even improve your results.
One meal does not make you fat or fit. It is the things you do in the long term!