Zid, I think you answered your own question there: "I also did diet by just eating a lot on breakfast, fruits and vegetables for lunch and dinner. I lost about 10-15 pounds by just doing that. And when classes started, I stopped doing it and gained about 10 pounds again.
The best diet isn't one you go "on" and "off," but something you can sustain regardless of your circumstance, or something that comes naturally. You are responsible for finding what works for you. In your case last year, it must have required a lot of conscious effort to eat a large breakfast followed by mostly fiber for lunch and dinner. It wasn't sustainable once the distraction and stress of studying kicked in.
Also, it bears repeating that there is NO diet that you do for 6 weeks to lose weight and then you can go back to eating whatever you want, as much as you want. It doesn't exist. If you have heard of one, it's a SCAM. The real secret behind losing fat and then maintaining health is building good habits, having realistic expectations, and accepting your body as it is, without making unfair comparisons to others. Their circumstances are their own.
1) eat real food - more vegetables, moderate meat, moderate fruits, less grains, less sugar, less vegetable oils.
2) exercise - moderate intensity cardio, sprinting, heavy lifting, dedicated stretching and mobility.
3) live - relax, de-stress, meditate.
Disclaimer: I'm not professionally qualified to make any formal recommendations. I've just done my homework and I'm my own guinea pig. All of my data, unless otherwise cited, comes from a sample size of n=1 (me).