Method 1: Restore deleted iPhone texts from iTunes
This works only if you automatically back up text messages before.
1. Disable automatic syncing in iTunes to prevent the program from automatically synching Texts with your iPhone: Run iTunes > Edit > Preferences > Devices, then check the box next to the option stating, "Prevent iPods, iPhones, and iPads from syncing automatically."
Note: If you do not disable automatic syncing, your iPhone and iTunes will begin the syncing process as soon as you connect the phone to your computer. If this happens, your old SMS on iTunes backup will be never restored forever.
2. Connect your iPhone to the PC with which you sync it. iTunes should pop itself up (if not, open it up manually). You should see your iPhone icon in top right hand corner. Select it. Now choose 'Restore backup' of the latest one you want.
3. All the data you previously backed up will now replace the data on your phone. It will take a few minutes. As long as you haven't backed up subsequent to deleting those text messages, they should now appear in the normal messaging list on your phone handset.
Method 2: Get back SMS messages from iCloud backup
1. Erase your iPhone: Go to iPhone > Settings > General. From there, choose Reset and Erase All Content and Settings.
Note: This will erase all the content on your iPhone. It will be replaced by the backup version stored in the iCloud. Any data saved on your iPhone since your last backup will be lost. So please make sure you have the latest and complete iCloud backup when you do that.
2. After erasing your iPhone, the device should prompt you to either set it up as a new phone or to restore it from a previous backup. At this screen, select "Restore from iCloud Backup."
Note: This will only work if you have previously backed up your iPhone using the iCloud.
3. Allow the content to download onto your iPhone. Your iPhone will restart itself and the backup data will be restored to your phone from the iCloud. This could take several minutes to complete.
Method 3: Retrieve deleted Text Messages with iPhone SMS Recovery app