If you accidentally deleted a text message on your iPhone, iPad, or iPod that you really need to get back, you may still be able to recover the SMS or iMessage using iExplorer.
The deleted SMS or iMessages might be stored in an iTunes backup which you could use iExplorer to browse these backups and recover the text messages. You can check for any recent iTunes backups by opening iTunes Preferences and view the list on the Devices tab. If you do see a recent backup that may contain the deleted texts, you can open iExplorer, click on Browse Local iTunes Backups on the connect device screen, or if your device is connected, look for the Browse iTunes Backups section in the left panel. Then, click on Messages underneath that backup.
If you don’t have a backup with the missing texts, there is another possible way to access the conversations in the SMS database file (sms.db). When you delete text messages, iOS just marks those texts for deletions but doesn’t actually remove them from the database. To retrieve this file, just go to the Backups section of iExplorer, choose Yes to make a backup. Then, once a backup is made, go to Backup Explorer > HomeDomain/Library/SMS and drag the sms.db file to your Desktop. Then, open the sms.db file in a text editor. Since it is an SQLite database file, it will look almost like gibberish but just scroll through and find the text from the conversations.
Also, Spotlight search on a device will sometimes retain deleted text messages, so you could view snippets of deleted texts when you search for any keyword that is in the deleted conversation.