I did the same thing, too. I wrote my thesis last year, so I stopped going to the gym around June. By November, when I submitted, I had gained about 8kg, which is a lot in 5 months.
Losing weight again is hard. So far I have found exercise to be the best thing, because even if I don't lose as much weight as I would have liked, I feel better for having done this for myself. Also, I have found keeping a food diary helpful, because then I'm accountable for everything I put in my mouth. Otherwise it's too easy to go "oh what the hell, one x
Anyway, good luck. Work hard, get results.