Imported from the Apple Support Forums via the Wayback Machine 🔗
If you were syncing photos with iCloud, check the Photos app, and at iCloud.com/Photos using a computer browser for a Recently Deleted album.
If you were syncing Messages with iCloud, you can't recover the deleted messages.
If you weren't syncing with iCloud (either one), restore from a backup.
Restoring from a backup erases all data currently on your device. Any data newer than when the backup was made will be erased. A restore is an all or nothing restore.