The AnkiDroid JavaScript API offers some advanced possibilities, although i’m not sure if it includes undo. And it is a ankidroid-specific feature, so by itself it won’t work across plattforms.
There is this addon, which offers some of the same functionality. But i haven’t tested it myself and am not sure if it works. See e.g. this thread.