It took me six months after each of my abdominal surgeries before I was back in the full swing of things. I got back in the gym after about two months, but nothing intense. Basically I started over after each surgery.
Mentally, it was a LOT tougher to come back from. I was in the hospital longer than a week for all 5 of my surgeries, and watching my progress yo-yo fucked me up in the head. My body recovered my quickly than my mind. In fact I still suffer from the shit I went through, especially because I have had complications that has put me in the hospital once or twice a year since the last surgery, which was ten years ago.
However, I never gave up training because I feel if I quit, I have given up on myself, and have lost my fighting spirit. The mental fight to overcome my odds has contributed greatly in who I am today. Considering all that I have been through, I have done a hell of a lot to not let it beat me.