Well, the undo buffer is actually saving every low-level paint and erase operation, so no, it has no way to "save" something that didn't happen. It is not saving a "state"; it is saving each shape that changed, and will undo by reversing every single action in sequence.