There are popups that tell you what was undone. So I think I'd be able to know what was just undone.
Otherwise, the undo popup could give that information if it has affected a hidden layer.
ie: Undo: Paint brush tool (Hidden Layer)
Maybe my workflow is different and it's a specific use case, but I constantly have this annoyance.
For example, I make changes to layer 1, then turn off layer 2 to see the effects. Then if I want to just undo the last action on layer 1 to see the difference, it turns on layer 2 again. So then I have to undo my change, whilst layer 2 is on, and then turn it off again to see the changes only on layer 1.
It just multiples the amount of actions or should take for something relatively simple.