Sounds like it is too late for the image you're working on, but for future, you can set the number of History States in Preferences > Performance. 1,000 is the maximum.
Whenever you are at a critical step that you may want to go back to, you can create a new Snapshot in the History panel. Unlike History States, Snapshots will always be there as long as the file is open.
... View more