Tragic things always happened before you know it, for example, you just cannot remember the passcode to access your iPhone to make a phone call. After attempting to enter the passcode as you can memorize to no avail for a few time, your iPhone will be disabled for long interval. After too many unsuccessful attempts, you won't be able to try again until you connect it to the computer with which you last synced it, if it has been synced to a computer.
If you can remember the right passcode during the interval, that would be great happy ending, you can leave this post alone.
If you cannot remember the passcode, you need to restore your device using the computer with which you last synced it with iTunes. By doing so, you can reset your passcode and resync the data from the device or restore from a backup. If you restore on a different computer that was never synced with the device, there is possibility to unlock the device and remove the passcode, but all your data will be overwritten and erased. The restore process may wipe everything out. Even the Apple representative cannot unlock your iPhone without restoring your iPhone.
How to unlock the iPhone and reset the passcode
Unlock iPhone which you have synced to your Windows based or Mac OS based computer computer;
Step1: Connect your iPhone to your computer [that you have previously used to sync the device.
Step2: In iTunes, select the iPhone in the "Devices" list, then "Summary" at the top of the screen.
If iTunes doesn't automatically synchronize your iPhone, do it manually and confirm that the sync and backup were successful. Click “Check for Update.” iTunes tells you if there is a newer version of the iPhone software available.
Step 3: Click Restore. Follow the onscreen instructions to complete the restore process. When restoring, it is recommended that you [again] backup the iPhone when prompted. When iOS Setup Assistant asks to set up your iPhone, choose "Restore from iTunes backup."
Step4: Select your device in iTunes and choose the most recent backup of your iPhone.
After the process completes, you have all the information you have synced to your computer with iTunes restored but it no longer will have the passcode enabled. So you need to reset the passcode.
Unlock iPhone which you have backed up with iCloud.
If you have been using iCloud to backup, you may be able to restore the most recent backup to reset the passcode after the device has been erased.
Step1: Sign in to iCloud with your Apple ID and remember to sign in with the one you use with iCloud and then click "Find My iPhone."
Step2: Click "All Devices," then select the iPhone you want to erase.
Step3:In the Info window, click "Erase iPhone."
Step4:Enter your Apple ID password. If the device you're erasing has iOS 7 or later, enter a phone number and message. This is intended to be displayed to anyone who may have found your iPhone if it is lost or stolen. To just erase the iPhone, it is not necessary.
Step5: And then get started to restore the information on the device using iCloud Backup provided that backup was turned on before you erased it.
Well if you haven’t backed up your iPhone either with iTunes or with backups, the only thing you can do is to restore the iPhone as new, which will delete all of your personal information presently on your iPhone.