If you have accidentally deleted text messages on your iPhone, here are some possible ways to try to recover these deleted text messages:
1.Recover from Backup: If you have made a backup on your iPhone, you can recover deleted text messages by restoring the backup. Connect your iPhone to your computer and open iTunes or Finder (in macOS Catalina and later). Select your device and select Restore from previous backups.
2.Restore with iCloud backup: If you have enabled the iCloud backup feature and have made a backup before deleting the text messages, you can try to recover the text messages by restoring the iCloud backup. On your iPhone, go to "Settings> "General", > "Restore", > "Erase All Content and Settings", and select Restore from iCloud Backup. Please note that this action will erase all the data on your device and replace it with the data from your iCloud backup.
3.Use a third-party data recovery tool: If none of the above methods can recover deleted text messages, you can try to use some third-party data recovery tools like dr.Fone, iMobie PhoneRescue, etc. These tools can scan and recover deleted data on your device, including text messages. Please note that you need to be careful when using third-party tools, make sure you get them from a trusted source, and follow the tool's how-to guidelines.
Important: Regardless of the method you use to recover your text messages, the success of your recovery may be affected if you've already made a new backup or done something else on your device after deleting your text messages. It's best to take steps to try to recover the text messages as soon as you find out that they've been deleted. Moreover, it is very important to back up your iPhone regularly to ensure that you can recover points from unnecessary data loss.