Generally speaking, if you haven't exercised for a while, and then your weight and body fat rate have increased, it may take you some time to regain your muscle mass and physical strength. This may take weeks to months.
When starting a new fitness program, I suggest you gradually increase the intensity and frequency of exercise to avoid putting too much pressure on your body. At the same time, pay attention to diet and rest to ensure that the body has enough nutrition and time to recover.
How long it takes to get back to your previous fitness state depends on your personal physical condition and hard work. However, as long as you insist on exercise and a healthy diet, you can definitely return to your previous fitness state.