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