Open Messages
Tap Edit or Filters
Tap Recently Deleted
Select the messages you want to recover
Tap Recover
Confirm recovery
Check if the messages are in another Apple device signed in with the same Apple ID
Check iCloud Messages if it is enabled
Restore your iPhone from an iCloud backup made before the messages were deleted
Restore your iPhone from a computer backup made before the messages were deleted
Contact your carrier if the messages were SMS and your carrier stores message records
Use a third-party recovery tool if you have no backup and the messages are not in Recently Deleted
