Recover deleted texts using an iCloud backup
Open Settings, tap on your Apple ID card at the top, select iCloud > Manage Storage > Backups. … Once your iPhone restarts and begins the setup process, choose to restore from an iCloud backup and pick the backup from before you erased your text message.