A few weeks/months passed in the movie. Time lapse was conveyed poorly.
Don't do drugs, kids.
That's even better than that.Really? Cuz, like, that's more than just conveyed poorly, it seemed like he woke up the next day and was fine.
Ealier in the movie, a doctor tells him he has almost no cartilages left in the shoulder, and the knee. He even has to use a device to help with his knee when he gets back as Batman.
Then later in the prison, he does a few push up, and has no problems anymore. Cartilages are back, that's how you do it kids