Undo runs out. Your history does not have to.
Krita's undo stack is finite, it lives in memory, and it empties the moment you close the file. That is fine for the last few strokes and useless for the hour you want back tomorrow morning. Saved versions cover the distance undo cannot.
Why undo runs out exactly when you need it.
Undo holds a set number of steps, and heavy operations on a large canvas eat through them quickly. Raising the limit costs memory on the same machine that is already carrying a layer-heavy painting, so it can only go so far. Then you close the file, and the stack is empty.
None of that is a flaw in Krita. Undo is built for the last few strokes, and it is very good at that. It was never meant to be a way back to Tuesday.
Saved versions are the long way back.
A version is a full point in your painting, written to disk with a short note in your own words. It survives closing the file, restarting the machine, and a week of other work. Scroll back through your history and pick the one you want, by look rather than by counting steps.
Because only what changed gets stored, keeping hundreds of them stays cheap.
Going back is reversible too.
Restoring an older version brings it back as a brand-new save on top of your history, so the versions in between are still there if you change your mind again. There is also an undo of its own: it lifts your most recent saved version back into unsaved changes, ready to redo.
Save a version at every good stopping point and undo stops being the thing standing between you and an hour of work.
Artist Mode reads version control in plain language: