You may be surprised to know that sugar may play a part in retaining water - too much of the white stuff can raise insulin levels, which affects the body's ability to excrete sodium. Exercise causes sweating, of course, and increased respiration, both of which help the lymphatic system drain fluid from tissues. Dehydration, whether through illness, drinking alcohol or not drinking enough water, can cause the body to preserve any extra fluids. Avoid alcohol, especially if you've been sick.
If you give the body plenty of fluids, then it'll be less likely to retain them. Stock up on foods that promote digestion and water shedding, like fibrous cereals and breads, brown rice, cabbage, and yogurt. Foods that are high in potassium, like bananas, also help the body balance fluids. Magnesium- and calcium-rich foods also aid fluid balance.