I recently stumbled upon a solution to an annoying problem with Photoshop that has been haunting me for as long as I've used it.
The problem is that using the "step backward" command can change the layer you have selected, often causing you to accidentally draw on the wrong layer if you're not careful. I know how annoying it is, so here is how you can stop it from happening:
1. Download the script called StepBackwardSmart from onepixelbrush.com/tutorials/ Look for "Photoshop Undo Fix"
2. Put StepBackwardSmart.jsx in the folder Adobe>Photoshop>Presets>Scripts
3. Open Photoshop (if it was open, close it and re-open it)
4. Go to Ed