How to keep the pounds off while on bed rest

Short

I was put on bed rest for the rest of my pregnancy and since then I’ve gained A LOT of weight. I’m barely allowed to move so I was just curious if there was a way to keep off the fat and just have the baby weight or if there’s no way. I just don’t want to gain too much excess weight of my own that will be very hard to lose once the baby is born