You have made a lot of changes then realise the last 100 steps you have done are all wrong, you press Ctrl + Alt + Z over and over until you can’t undo any more?!

You can add many more undo steps to Photoshop so you can keep hitting Cmd/Ctrl + Alt/Opt + Z to step back.

Go Photoshop > Preferences > Performance or hit Cmd/Ctrl + K to open the Preferences panel.

When in Performance move the vertical menu on the left and drag the “History States” slider to whatever number you like.

NOTE: More history states will slow down Photoshop.