Although disk brake rotors are relatively well protected, they sometimes get bent in a crash or even just by careless handling of the bike or wheel.
It is easy to bend a rotor back using a crescent wrench or locking pliers. However, it’s hard to bend it back straight. If the wheel won’t turn because the rotor is so far out of shape, make it mainly flat before inserting it. Now, spin the wheel and note which parts of the rotor are kinked by listening to where it rubs or by looking at the air gap between the rotor and the pad in the caliper. Be careful to undo the kink in bent parts rather than bending still more of the rotor off center.
For sharp kinks, use the crescent wrench close to the brake caliper so that the pads in the caliper stop the rest of the rotor from bending with the kink. For bigger wobbles, use the crescent wrench in a location where the whole rotor can flex.
Proper rotor truing tools have two different slot depths, so that you can bend just the braking surface on the outside of the rotor or bend the whole rotor from near the center. You can try and replicate this with your crescent wrench on the trail.
If the rotor is really badly bent, you may need to remove it from the wheel in order to continue riding. If you do this, place a wedge of wood between the pads to keep them in place.
Tip: rotors get very hot – especially after a long descent. Wait for them to cool down before working on them. A friend of mine was branded by a rotor after another rider fell against him. The welt lasted several months.