How to rerail?

How does one drag a derailed modern big heavy locomotive back onto it’s wheels and onto the track? Let’s assume that it is 100 ft away from the rails, on its side or roof, and down a small embankment.

How was it done with old steam engines? (and existing equipment)

Though I wasn’t there at the time, a guy I met at a BNSF testing and interview session told me he recently saw a derailed UP locomotive. The railroad was using a big crane to set the locomotive back onto the track.
I suppose the crane is used quite frequently, as long as the engine will still roll and the trucks have not been damaged.
Of course, I could be wrong, certainly not the first time.

May never happen if the loco rolled into a remote spot. There is a CSX locomotive over the side of 17 mile grade in Western Maryland. To difficult to be retrieved it remains abandoned today.