You can undo and redo typing on an iPhone by quickly shaking your device. You can also use the "Select" and "Cut" features to delete (and paste) text.
If you set up WhatsApp to create a backup, you have the option to recover deleted messages on the app.
If you want to recover a text message, tap on the thread or message so that it's selected, hit Recover on the bottom right, and then tap Recover Message in the pop-up that appears. You can also ...