This conversation has been merged. Please reference the main conversation: Photoshop: Don't understand the undo/redo system
And you have layerB selected:
 layerB < selected
Then you select layerA:
 layerA < selected
Then you paint a brush stroke on LayerA
 layerA < selected, now with one brush stroke
Then you undo that brush stroke. (CTL+Z)
What you get is:
 layerA < brush stroke removed
 layerB < selected,
It undoes not only the brush stroke but the layer selection operation.
What I'd prefer would be to end up with:
 layerA < selected, with brush stroke removed.
I can't tell you how many times I've been working on an image with multiple layers, selected a new layer, painted something that I didn't like, undone that operation, and then discovered sometime later that I've been painting on the wrong layer for a while because of this behavior.
It's not a huge deal of course, and there are plenty of workarounds, but the behavior seems a bit strange and unintuitive. Lesser programs could not be bothered with such minor issues, but Photoshop, and the near pinnacle of perfection that the program represents, might have the motivation to address this tiny blemish on it's smoothly polished interface.
It's like a chip in the paint of a car. For an ordinary car, this wouldn't matter, but Photoshop is a Lamborghini, and it needs to shine.