This function isn’t meant to be a secret, but in my experience most iPhone users don’t know about it—and it can save a lot of headaches.
If you ever make a mistake typing, deleting, cutting, or pasting, here’s what to do.
Just shake your phone like you’re furious. (This will not be hard.)
Click undo, and your text will be restored.