1.With your iPhone connected to a Wi-Fi network, launch the Settings app and tap your name.
2.Now, you need to effectively wipe your iPhone clean, which means you have to tap Erase All Content and Settings.
3.With that in mind, launch the Settings app and tap your name. Then tap iCloud.
4.Go back to the main Settings screen and tap General. Then scroll to the bottom of the screen and tap Transfer or Reset iPhone.
5.You will see information about the backup — the most crucial being when it was last made. If it looks as if it will contain the deleted message, then it's time to try and get it back.
6.Now tap Manage Storage (if iCloud Backup isn't turned on, then your chances of successfully recovering texts is going to be much lower).
7.On the iCloud Storage screen, tap Backups and then select a backup that you think will contain the message that you want to retrieve.
8.It's worth making sure the toggle next to Messages is turned on. You should also tap on iCloud Backup. You might find that this is already turned on – in which case, automatic backups are already being created. If not, then you can easily rectify that.
9.Your iPhone will shut down and restart. When it comes back to life, go through the setup process and, when you arrive on the Apps & Data screen, tap Restore from iCloud Backup. Choose the backup you identified earlier in the process. All of your backed up data will now be restored.
10.Make sure you switch on iCloud Backup. If you have just turned it on, then tap Back Up Now. You should also do this if it appears your iPhone hasn't automatically backed up in a while. It will only do this when your iPhone is plugged in, locked and connected to a Wi-Fi network.