The principal (history, undo) has previously been discussed here. It’s more complex than it might at first appear.