The fitter you are before you undergo knee surgery the faster your recovery will be after the surgery. You should begin your pre-operative exercise routine now/on the advice of a consultant and continue to the day of your surgery.
Having your knee surgery will correct the structural problem, but you will need regular exercise to strengthen and stretch your muscles to regain full function, avoid pain and prevent re-injury.
Keep your goal in mind, this will help to motivate you to be consistent in your exercises pre and post operatively.
NOTES:
Exercises should be performed in line with the condition of your knee
If swollen and painful stick to lower level (and pain free) exercises
Ice 3-4 x/day for 15-20 minutes to help swelling reduction (always protect the skin when doing so)
Regular mobility exercises to regain full range of motion
Avoid sudden/aggressive change of direction