The best way to recover deleted text messages on your iPhone for free is from an iCloud backup using the following procedure. This process overwrites all current data on your iPhone, so back that up before proceeding.
Open Settings on your iPhone and tap on your name/picture at the top.
Select iCloud > Manage Storage and then tap Backups.
Search the available backups for one that was created before the messages were deleted.
Go to Settings > General > Reset > Erase All Content and Settings.
When prompted to recover from a backup, choose the one you identified earlier.