On the Mac, you can always hit Command-Z to undo something. You can also hit Command-Shift-Z to redo something and put it back to what it was before you hit undo. Make sense?
This isn’t so easily done on iOS, as there isn’t a Command key, to being with, but there is, in fact, an option to undo and one to redo hidden in the iPad keyboard. Here’s how to get to each of them.