You set a passcode for your iPhone in order to protect personal information stored in iPhone from being stolen by others who get your iPhone, but nothing is more frustrating if you forget the passcode for accessing your iPhone. If you forget the passcode for your iPhone, you also have no chance to access your iPhone unless you can reset your iPhone. However, it will erase all data stored on the device by resetting your iPhone. iPhone offers a secure method by wiping all data when you reset it so as to prevent others from accessing your important data. Then, what can you do to gain access to your important photos, videos, contacts, messages, etc from a locked iPhone after forgetting passcode?
On the one hand, you can check iTunes or iCloud backup to try to restore your locked iPhone from iTunes / iCloud backup. And on other hand, if there is no iTunes / iCloud backup, you may use data recovery for iPhone to restore lost files from a lock iPhone.
When your iPhone is locked, you can reset it in order to gain access to the iPhone. However, you will lose everything stored on your iPhone after resetting. Therefore, you had better backup your iPhone before resetting it in order to avoid data loss. As an iPhone user, you may be quite familiar with iTunes and iCloud. Both of them are applications released by Apple Inc, with which you can backup or sync your iPhone device. Therefore, you can backup your locked iPhone with iTunes when you forget the password to access your iPhone. You just need to connect your iPhone to the computer with which you have previously backed up your iPhone and then follow this guide to backup it: Run iTunes on your computer > Select iPhone device in iTunes > click "Summary" > select "This computer" and click "Backup Now" button.
1. If your iPhone is connected to WiFi before it is locked, you can also backup iPhone to iCloud. Usually, as long as your iPhone is connected to WiFi, the data will be automatically backed up to iCloud.
2. If the locked iPhone is not connected to WiFi, you can only backup it with iTunes.
After backing up your iPhone with iTunes, you can reset it without worrying about data loss. Generally speaking, you can try to restore locked iPhone to factory setting without password with iTunes by following the steps below:
Step1. Connect your iPhone’s USB cable to this computer (you should only insert the USB cable to your computer, but leave the iPhone being disconnected).
Step2. Turn off your iPhone by pressing Power button. Then, run iTunes on the computer which has a USB cable being connected.
Step3. Press the Home button on your iPhone and connect it to the other end of the USB cable so as to connect the iPhone to the computer. You should keep pressing the Home button before getting a message saying that iPhone is detected in recovery mode.
Step3. When you receive the message showing in step2, you can click "OK" > click "Summary" tab in iTunes > click "Restore" button.
In fact, even if you have no way to access a locked iPhone since you have no password, you can restore iPhone from iCloud backup or iTunes backup if you have backed up your iPhone in advance. Or you can use data recovery for iPhone to recover deleted files from iPhone without iTunes / iCloud backup.