Depending on where you’re starting from, any activity upright on your feet will help you gain muscle and bone density.
Don’t expect it to come back as quickly as it went. Being bedridden or in a weightless environment like space is devastating for muscle mass, and it takes a surprisingly long time to recover. You have an advantage being young. Be patient!