Before you send your device
Follow these steps before you send your device in for repair or replacement. If it won't turn on or respond, finish as many steps as possible:
- If you need to send in an iPhone that's paired with an Apple Watch, unpair your devices. When you unpair, your iPhone will create a new backup of your Apple Watch. You can use the backup to restore your Apple Watch when your iPhone returns from service.
- Back up your iOS device.
- Go to Settings > Messages and turn off iMessage.
- Go to Settings > [your name] > Find My [device], then turn off Find My [device] to disable Activation Lock. Enter your Apple ID password, and tap Turn Off.
- Erase your device. Go to Settings > General > Reset > Erase All Content and Settings. If asked, enter your passcode and Apple ID password. If you can't erase your device because it won't power on or isn't responding, you can erase it from iCloud.com. Learn how.
- Remove any SIM card, case, or screen protector from your device and keep your cable and charger.
Now your device is ready to send. If you arranged a repair request, you should have received instructions for how to mail in your device. If you didn't get instructions or you haven't set up a repair request, contact Apple Support.
https://support.apple.com/en-us/HT201557
If you didn't follow Apple's instructions and perform #2, your data is gone.