I have more than once gained that amount of weight in short periods of time, for various reasons, and I've got a body full of stretch marks to prove it!
Shame builds up in our minds and hearts and then we feel the need to 'swollow' it so we eat more, to numb the feelings, and food can be a drug just like any other drug!..I've been on that emotional eatting rollercoaster and I'm not perfect, but I'm soo much better than I used to be. You can change what you think it takes constant effort. Have you heard of a process called EFT? it look silly but it worked for me, to help me change that emotional garbage that just sabotages us.
I've come to believe if you change the mind the body will follow, but it's a big mountain to climb. Dont give up you can do this!