http://www.sniksnak.com/cathealth/
Check this site. It's not the only one, but covers a lot. I go back to it often and have had cats for years.
You mentioned surgery, that means different surroundings, and probably anesthesia. Was your cat at home when awakening? If not, your cat might not have had a litter box when awake and needed for the first time after surgery.
Now re-training might be indicated through words of approval or disapproval. When one of mine came home she was awake and did the same thing, I took her to her box and we sat there together until she had to go again, I placed her in her box and while she was busy, I spoke to her repeatedly and told her she was a 'good girl' which she was used to hearing as a message of approval. That worked for us. Since cats are more intelligent and don't need goodies all the time, repeated words they know the meaning of do more to get their attention. Good Luck