If you have ever backed up your iPhone to iCloud or iTunes you should be able to restore your iPhone text messages from the backup.
Unfortunately, iCloud doesn’t back up texts in all territories, and for all phone operators. My iPhone on O2 falls into this category. So the following may not work. You’ll need only to go to step 2 to find out.
1. Log in to https://icloud.com with your Apple ID and password
2. Click on Text Messages (if it isn’t there your messages haven’t been backed up).
3. If it is there searched the messages to find the ones you need.
4. Now go to your iPhone and choose Settings, iCloud on your iPhone.
5. Turn off Text Messages (or ensure it is turned off). I know this sounds counter-intuitive but stay with it.
6. You’ll see a pop-up. Select: ‘Keep on My iPhone’.
7. Now turn back on text messages.
8. Tap ‘Merge’, and wait. After a few minutes the deleted text messages should appear back on your iPhone.