Something from the world of diabetic cats which may be applicable -- start low and go slow.

After abdominal surgery two years ago I got discouraged about my loss of fitness, and would sometimes make things worse by overdoing it. I eventually realized that I'd just need to let my body heal on it's own schedule, and turned to non-bike activities for most of my recovery. I found walking very helpful, also tai chi and stretching.

So don't beat yourself up, and if you make returning to fitness a goal, it will happen.