In most desktop applications, the Undo command (Cmd+Z) will allow you to “undo” any number of changes you’ve made whilst editing your document. However, in Photoshop, Cmd+Z toggles between Undo and Redo, meaning you can effectively only “undo” the very last change you made.
This can be frustrating because even though there are other ways of undoing multiple changes in Photoshop, your natural reaction is to press Cmd+Z.
Fortunately, there's a quick fix that will put an end to your frustrations.
Associated with the History panel (Window > History) is a command called Step Backward, which behaves much like the traditional undo, allowing you to go back through the “history” of your document one change at a time.
The default keyboard shortcut for Step Backward is Alt+Cmd+Z, which you can use as is.
But like me, you might find it more useful to change the shortcut to good old Cmd+Z.
To do this, go to Edit > Keyboard Shortcuts.
Click the arrow next to Edit to expand the list of menu commands.
Select the Step Backward shortcut and change it to Cmd-Z by pressing the keys on your keyboard.
Click Accept to confirm the change and Undo/Redo will automatically be allocated another available shortcut.
Now you can use Cmd+Z to “undo” as many changes as you’d like.