Open the Messages app
Tap Edit in the top-left corner
Tap Show Recently Deleted
Select the messages you want to recover
Tap Recover
Tap Recover Messages to confirm
If you use iCloud Messages, check other Apple devices for the deleted conversation
If the messages are not in Recently Deleted, restore your iPhone from an iCloud or computer backup that contains the messages
To restore from iCloud backup, go to Settings
Tap General
Tap Transfer or Reset iPhone
Tap Erase All Content and Settings
Set up your iPhone again
Choose Restore from iCloud Backup
To restore from a computer backup, connect your iPhone to a Mac or PC
Open Finder on Mac or iTunes on Windows or older macOS
Select your iPhone
Choose Restore Backup
Pick a backup made before the messages were deleted
If needed, ask your carrier whether SMS message records are available
