UNdo system not working right

Working with landcape here, and simple meshes in scene, and trying to undo a ‘flatten’ instance, and instead of reversing JUST that action, reversed everything I had one today , which isn’t a lot and I can easy enough recover, but why doesn’t UNDO, ONLY the prior action which was the flatten, and bypass that last action and undo several prior steps before ?

Is there a cache to clear- has the undo cache been corrupted , is that even possible as such ?

ty