Did you know that your iPhone and iPad have an Undo function? Sometimes you see that appear above the keyboard. But even if you don't see it there's a way to undo with just a shake. A lot of people don't know this.
For instance, here I am in the Notes app. I'm going to delete this last word here. Uh oh, I didn't want to do that. So how do I undo? All you need to do is shake. You get this little Undo Typing thing here. I can Cancel or Undo and it puts back what I had there before.
It works in other cases too. For instance, here I've got a mail message. Say I go and let's delete it and I want to undo that. Well, the same shake will work there as well and will put back that message.
So it works in a variety of different apps and a variety of different situations. If you ever want to undo something and don't see an obvious Undo button on the screen anywhere just give your iPhone or iPad a shake and a lot of times you'll get this prompt to undo the action that you just did.