Best part is I was able to totally avoid writing any sort of “action” system where actions could be done and undone. All the existing code that modifies the map state remained almost identical. The only change was an extra call to save a map snapshot in a few places.