During pregnancy your body collects body fat and stores it for later use and protection. In addition your body increases water retention and overall blood volume. After pregnancy you will retain the excessive water weight and blood volume for a few weeks. After a few weeks the water retention will slowly subside. To get rid of the extra fat stores collected during pregnancy and general exercise will help reduce body fat.
In order to lose weight you need to have a negative caloric expenditure. This can be accomplished by diet alone. However, you will need to significantly reduce caloric intake. However, exercise will increase caloric expenditure and raise metabolism, which means you will continue to burn calories through the day and boost your energy. Exercise and diet can create a calorie deficit leading to fat loss.