How to lose weight while pregnant?

I need to lose at least 30lbs before delivery for both mine and the baby’s benefit. Doc says its okay for a woman my size to lose weight while pregnant because I’ve got enough fat stores to fulfil the baby’s caloric needs. I’m due 11/7 so I’m 6 weeks.
Oh, also I was in the process of losing weight until I found out I’m pregnant. I was using medifast(can’t continue because ketosis harms the fetus)now, that I’ve stopped using medifast, I’ve already picked up 4lbs! How do I reverse this gain and continue going DOWN the scale?
Thanks everyone!