Any fitness junkies out there? Need help

I had a surgery and the dr said no exercise for 3 weeks!!. Will I lose all my gains? I lift heavy and eat a lot of protein as I am trying to build muscle mass in my legs and tone overall. I'm worried these three weeks I'm going to lose what I've already built. Any advice or experience would be awesome ! Thanks ladies