You will have to restore your device from a backup created before those messages were deleted:
Restore your iPhone, iPad, or iPod touch from a backup - Apple Support
Just be aware that restoring from a backup is an all or nothing process. You cannot only restore messages (for example) and any information on your device between now and when the backup was created will be lost.