Open the Messages app
Open the conversation with the message you want to unsend
Touch and hold the message bubble
Tap Undo Send
Make sure you do this within 2 minutes of sending
Both you and the recipient need iMessage and a compatible iOS version for Undo Send to work
