Hopefully I can explain this behavior clearly. I have "Command + Z" assigned to Step Backward in history to give roughly the same functionality as multiple undo in most any other app on the Mac.
When I'm doing illustration work in PsCS4, I'll often switch from Layer A to Layer B and make a mark with the Brush Tool. I'll decide I don't like that mark, so I Command + Z to "undo" that first mark made since switching to Layer B. The Step Backward does it's thing and gets rid of the mark as expected, but also switches back to Layer A, instead of remaining on Layer B so I can create a new brush stroke.
My request is that Step Backward should stay on a Layer until it reaches a point in History where it's "un-doing" something that happened on a different layer. Or another way to put it: Layer Switching should not happen until the instance of Step Backward would be un-doing an event on on another layer.
Or at least make this a user-defined pref?
I encountered this misbehaviour many times myself and would like
to see it fixed as well.
For me it happens when pressing alt+ctrl+z after a single brush stroke on a newly switched layer.
And to replicate this problem I had to create two new empty layers, then switch to the second layer and make a stroke there. After pressing alt+ctrl+Z photoshop removes the stroke and jumps to layer 3.
Hope it helps to catch the bug.