Definetly need some help!

Options
Hi guys-
So basically I went home this summer after my first year at uni and got on the scales. Big mistake- 11 stone 4, (158 lbs) so I decided to cut portion sizes, go the gym 5 times a week etc.
Then I came back and had a week seeing family and friends and decided to eat as if I was maintaining and to see if I wanted to maintain for the month I have off between summer, uni and gym memberships. I didnt enjoy that so steadily Ive been cutting back again. I plan to go to the gym 4-5 times a week when Im back at uni and eat healthier than I have been recently too.
One problem- I have slipped up a fair few times and I was wondering if anyone has any tips on how not to really? Like snacking when you shouldnt and stuff. Itd really help :)