If you are recovering from a sports injury or other trauma then yoga can be very useful. On a physical level it can help repair and rebuild damaged tissues by its gentle but powerful stretching and strengthening. Another physical benefit of yoga, applicable especially to lower limb injuries, such as a sprained ankle, is that it improves and fine-tunes your balance. This is particularly true of the standing postures. Yoga can also help your mind deal with the shock of damage to your body, and help you recover from the fear of re-injury.
Many people experience pain as a result of or while doing yoga.
It is important to try to distinguish between the pain that is warning you to stop before injury and the pain of adjustment. Your best guide is yourself, followed by your teacher. Warning pain tells you to ease off. Adjustment pain tells you to proceed with caution as you work something out, like an old injury. Yoga in this sense can be a form of self physical therapy.