1 - shut the ignition off ASAP (even during the flop if possible). Prepare for fire, get the extinguishers handy.
2 - evaluate injuries to people or pets. Attend to those first, forget about the stupid paint, metal and rubber damage.
3 - recover the vehicle. This is as dangerous or more dangerous than the initial flop. This takes a lot of knowledge to right vehicle without causing further damage. The use of winch blocks is highly advisable to lessen the work on the winches doing the recovery, it also makes it much more controllable up until the point of gravity taking back over. Doing this type of recovery is exceptionally technical and actually is very helpful if you have had professional lessons/training.
4 - once vehicle is righted, a seriously detailed assessment of the damage to the engine needs to be done before attempting to restart.
5 - No need to drain the oil! That serves no other purpose other than to make the trail even more messy. However, you do need to pull the spark plugs to release any vacuum in the cylinders that might be keeping oil from returning back into the pan from the cylinders. Also pull the air filter to see if oil has made it up through the intake manifold and all the way to the filter element.
6 - once it has been deemed safe to attempt an engine turn over, and with the plugs still out, crank the engine over to purge the cylinders of oil. Caution: this is super messy, oil is going to spray everywhere.
7 - Once the cylinders seem dry of oil, clean all the spark plugs with brake cleaner really well. Reinstall spark plugs, check engine oil level on as flat a surface as possible and top off. Top off all other fluids too at this point.
8 - start vehicle, prepare for lots of smoke......which will eventually go away. Now drive off trail.
Caveat: it is possible that you may not have to pull plugs, but this is an advance technique to check if motor is hydro-locked, but I will not cover that here.
For all you newer guys here on the forum, during the pre-run for the King of the Hammers 2013 race, my jeep was flopped on the first day of the run. Basically using the outline above, we recovered the jeep, finished pre-running that day and the next day too and then I drove the 435 miles from Johnson Valley back to Scottsdale, AZ