It’s not possible to stay as small as you can become when you’re dieting; putting on some weight after your diet is inevitable. Set yourself a limit beyond which you do not want to go, and accept that at times you will probably have to ‘diet’. It’s not a failure to have to actually lose weight sometimes. If you put on weight, don’t give in to it or berate yourself. Deal with it and get back on track, whether just making some small changes to what and how you eat/drink for a few weeks or even having to diet for a short while to just get back on track.