After more than 15 years covering everything Apple, it’s with a heavy heart we announce that we will no longer be publishing new content on iMore and the iMore forums will be closing as of November 1st, 2024.
What kind of messages? Email, SMS, iMessages? If email messages, you can retrieve them IF they are still in your Trash/Deleted folder. For SMS/MMS/iMessages, once you've deleted them, they're gone unless you have a different iOS or OS X device configured with the same iCloud/Apple ID and is configured properly. If so, check that device.
If they were backed up to iCloud, you might get them by restoring your phone to the iCloud back up. But if another back up has occurred since you deleted the messages, they're gone. iCloud backs up what is currently on your phone. It's not a storage option like Dropbox.