Only your doctor can tell you what you can and cannot do following surgery so always follow his or her guidelines. If you have been given the go-ahead to exercise, ask specifically what you should be doing. The better shape that your whole body is in, the better it is for your back, but you must be careful and only do what you have been told you may do.
That being said, usually a good exercise for your whole body is something like swimming, walking or bike riding. These exercises work out muscles throughout your body without added strain to your back. Unless given the ok from your doctor, avoid exercises that do strain the back. These include high-impact exercises like running, jumping, climbing or lifting weights.
Finally, don’t underestimate the importance of stretching. Good stretching allows for the muscles to work effectively.