Don't beat yourself up; it will come. Get plenty of rest between rides. The most important part of "training" comes on the couch.
Before
my accident I was capable of riding 400 hilly kilometres in a day. I re-attained that ability after coming back from cancer treatment.
Again, all being well, I will be back at square one, sometime next year and I can begin my journey back to health.
The key is to have patience (not my best asset) and not overdo things at the beginning. Soon you'll be surprising yourself. What once looked like a hill will be forgotten in the larger perspective of a ride. And you'll get faster too.