Had a TB mare once did this. Put her on stall rest for about two months. She was mad. Made her kick the walls and stuff,after being on track she was hyper, thought she would not make it if she did not quit. Then moved her to a very small paddock so she could walk around but no trotting or running. Kept her there for six months! Had to. Then next three months moved her to a SLIGHTLY bigger area so she coud trot. After she began to trot and things with no problems or signs of lameness after about another three months, I moved her to a even bigger area where she could trot, possibly canter but not open up. She did well and can now gallop with the best of them. I never used her for riding only for broodmare. She is a fine horse. I would consult with vet about it all because it depends on where, how extensive what is recommended etc. Also how much time you will put into a horse because as you can see it took me well over a year of good care to bring my horse around. Good Luck.
Confidence doesn't come out of nowhere. It's the result of something...hours and days and weeks and years of constant work and dedication.