'undofile', one can hold
u or execute
'undofile', everything changed, hold
u will undo changes made in older sessions,
undo 0 will undo the entire undo history, they became useless.
:earlier 2h family command only works on certain conditions, it's not so useful if you create a new vim session in a short time after you close one.
I know the undotree plugin, but have no idea how to use it to do this job, trying saved text state is not an option.