I find this quite annoying, I'll select a new layer, move something on that layer and then hit undo. Instead of just undoing the thing I moved it undoes that plus it takes me back to the previously selected layer. This is a bad feature, is there any way to turn this off so layer selection is recorded in the undo?
Actually, (Undo/Redo) Ctrl+Z doesn't change layers. (History Step Back) Ctrl+Alt+Z selects the previous edited layer. I've gotten into the habit of hitting Ctrl+Z then if I need to undo more I'll use Ctrl+Alt+Z. But just for single undos Ctrl+Z will keep your layer selected.