Is it safe to diet during pregnancy?

Cassity • Laila 05/15/17, Xander 4/10/18, and Grace 11/06/2019

I just had an OB appointment and I learned I gained a lot of weight. I'm 28 weeks and have gone from 130 to 123 to 154. I've never in my life been so heavy and I'm extremely upset. I haven't been eating incredibly healthy so that's probably how I gained so much. I'm used to having a wicked fast metabolism so I can usually eat whatever without gaining anything. My mother in law is always calling me fat or saying I got so fat and that she was never this fat with all of her pregnancies which hurts my feelings more than you'd think. I know I'm carrying a baby and ik I'm supposed to gain weight but I'm only 28 weeks and I've gained so much so quickly. My OB says I'm gaining too much and to start eating healthier so no more cereal for breakfast and lots of fruits and veggies. Lots of eggs and to limit carbs and sugars. I picked up some yogurt and fruit and veggies and eggs. I wish I could start losing weight now but I know that's not healthy for little man. It won't hurt him with my diet changing will it? I'm not dieting per se but eating way healthier and changing those eating habits. All in all I just want what's best for my sweet baby boy

First pic is before pregnancy. 2nd pic is from last night.