We generally anticipate results too soon after starting exercise. Already a week in, we look forward to the scale every day. Weight usually increases, contrary to expectations.
Putting on weight from muscular discomfort is a common side effect of beginning an exercise routine. The muscle tissue breakdown that happens during exercise causes the soreness that you feel over the next day or two.
It happens to shield the intended muscle groups from the effects of the new routine. It's important to keep in mind, though, that muscular pain is just transitory, and it often fades away by the second week.
Muscles use fluid retention as a secondary defense strategy. The muscles may retain some water and become mildly irritated as a protective mechanism against the effects of the new workout routine.
The weight gain from this transient fluid retention might be as much as 2 kg. The first shock of your new routine will go away within a few weeks.
There are muscle cells and water in a muscle. Muscles, especially large ones like the ones in your legs, can grow in size when you start working out consistently.
However, muscles take up less room than fat. Your weight may grow, but you will thin down. But this weight increase is OK. In fact, you may be healthier.