Don't get down. It happens. And, although we always sterotype women for feeling frustrated, depressed about their bodies, plenty of men (especially ex athletes) go through the same thing.
Though, not as much weight as in your experience, I had a pretty significant weight gain (50lbs) in law school. Had a shin splint right before starting, couldn't be active like I was used to. Then just stressed out by school which led to eating (bad food) and drinking. Plus, there were legit reasons to eat and drink besides stress. I was in school, I wanted to be social and go out with my classmates. Then I was semi-depressed at getting in such bad shape, blah, blah. It was a pretty quick cycle and before I knew it I couldn't recognize myself. It sucked.
During my third year, I took stock of everything. Basically laughed at myself. Realized that if I could put it on, I could take it off. At first, I just cut back on food and drink. Seriously, didn't even really improve the quality of food and drink. I still ate some bad food and drank alcohol, but just less.
Started walking everyday. Would go to the track and run a little. Frustrating because my performance was SO much worse than previously, but I always felt so much better. And exercise actually reduced my appetite. Then I started to improve food choices - no eating late, more fruits and vegetables, lean protein, salads, whole grains.
then, it all started to roll the other direction. I got in better shape which would enable me to work out longer or more intensely. Kept on eating good, but was realistic - it wasn't like I was never going to have a beer or a slice of pizza again. Just tried to eat well most of the time, and when I didn't eat well, I didn't go crazy - 2 beers when out at the bar, instead of 5. 2 slices of pizza, instead of a whole pizza. If you can learn this, you can stay sane while you get in shape. Eventually, I lost all the weight.
When I was younger (I'm now 40), I exercised so much that I could basically eat what I wanted. Now, diet is much more of a focus. I'm not going to recommend any particular diet, or even recommend something called a "diet". Everyone knows that overall calories, moderation, healthy foods, etc., are all necessary. It's a change in habits.
The one tip I will offer is don't look at your progress, your days of trying to get back in shape as an "either-or" propositon. I see too many people do this. In their mind, they have to be "perfect" - all vegetables, brown rice, lean protein, no sugar, etc. They'll do it for a day or a week, but inevitably something will happen. They get invited out and have a beer. There's cake in the office at lunch and they have a slice. They're in a rush, so go get a sandwich at Jimmy Johns or a slice of pizza. That will happen, and if it does, just regroup. Do not use it as an excuse to go crazy and tell yourself you'll start being perfect again the next day. Again, I see it a lot. People dedicated to eating better and generally doing well, but one thing goes off-plan, so they figure, "well I screwed up today, so I might as well eat like I used to, lots of junk food, big amounts, and I'll start tomorrow." That's the road to nowhere, because you'll inevitably, repeatedly not be perfect. So, if you have a healthy breakfast, and then for some reason have a candy bar during the day, fine. Regroup and eat a healthy dinner, and go from there. Don't destroy the day and start over tomorrow. It's all about the big picture.
And, of course, activity. Again, no need to be perfect every day. Just do something. Running, swimming, biking, tennis, weights, whatever. Try to get your heart rate up. Walking is underrated and a good thing to do when you're sore or if your motivation is really down for exercising. Just get your phone or MP3 and something you enjoy listening to and go for a walk, outside or on the treadmill.
It's a slog, but once you get going, you can do it. And, you'll be happy you did. Good luck!