This looks like an I6 thing? At least that’s all I could dig up. Let me know if you can’t read the snippet.
Note: this doesn’t work on the first turn of play because there’s no state to revert to (hence the wait in the “test me” command). Should be able to oppress the previous turn undone message, but I haven’t experimented with that.
Note, I don’t actually know much about I6, so someone jump in with a better answer if appropriate!