Undo on iPhone

Have you ever accidentally deleted the contents of a Note on your iPhone or iPad? There doesn't seem to be an undo button. It stopped me from wanting to use Notes for a long time. Not any longer, here is how to undo the last thing you typed or deleted on your iPhone.