Stop guessing before trying another recovery path
Note the exact message and any countdown, roughly when you changed the passcode, and whether you confidently remember the previous device code. Do not post the code or a list of possible codes in a screenshot or support request.
Apple’s optional Erase Data setting can erase the device after ten failed passcode attempts. Apple also describes a computer restore being required after ten failures when that setting is off. Do not assume another guess is harmless or that you know how many attempts remain. See Apple’s passcode settings and attempt warning.
This guide starts from the recovery choices actually displayed on your phone. If you are not at that screen, do not generate a series of failed attempts to force it to appear. Ask Apple for guidance first if the attempt history is uncertain. If touch is selecting buttons by itself, stop entering codes and use the broken-screen data-preservation guide.
Check whether the previous code is still eligible
- Software: Apple’s feature requires iOS 17 or later. It also exists on iPadOS 17 or later; this page follows the iPhone screens. Earlier software has different recovery options.
- Timing: the passcode was changed within the preceding 72 hours. Count elapsed hours from that change, not from your first failed entry or the appearance of a lockout message.
- Known previous code: you remember the device’s previous unlock passcode. An Apple Account password is a different credential.
- Still available: the old code has not been manually expired. Apple also describes previous-passcode access as a one-time use; do not expect unlimited reuse.
Apple’s previous-code expiry explanation and passcode settings guide cover these limits. If any item is unknown, record that uncertainty rather than trying a collection of old codes.
For the on-device Forgot Passcode? option, Apple lists a cellular or Wi-Fi connection, an Apple Account signed in on the phone and Find My already enabled. A missing button alone does not tell you which condition failed. Check Apple’s on-device recovery conditions; do not erase the phone to try to make that option appear.
Choose the previous-passcode option on the phone
- When the phone already shows iPhone Unavailable and offers it, tap Forgot Passcode?. Respect the displayed wait or instructions.
- Look for Enter Previous Passcode. Apple’s illustration also refers to trying Passcode Reset. Follow the choice specifically for the previous device code.
- Enter the known previous passcode on the iPhone itself, then follow the prompts to set a new passcode immediately.
Apple documents this route without resetting the device. Enter the old code only in that labeled recovery prompt. Stop if a device-reset or erase confirmation appears.
After access returns, confirm you can open important photos and apps, and make sure you can remember the newly chosen code. Keep it private. Then protect the data with a current backup; successful access is the opportunity to preserve the files.
Let the displayed result choose the next step
- The previous code is accepted and a new code is requested
- The recovery route worked. Finish the on-device prompts, confirm access and back up before doing other troubleshooting.
- The previous-code choice is absent
- Check software, elapsed time and the listed connection/account conditions. Do not treat the absence as proof of data loss or a hardware fault.
- The old code is declined, or you are unsure which code it was
- Stop further guesses. Keep the exact message and ask Apple to review the available options before any erase.
Why might an old code fail even within 72 hours?
Apple’s Expire Previous Passcode Now setting can end the grace period early. That may explain a rejected old code; it does not prove what happened on this phone.
After you regain access, you can review that setting in Settings → Face ID & Passcode or Touch ID & Passcode, depending on the model. If the old code was changed because somebody else knew it, consider ending its grace period once you have confirmed the new code. Apple explains the expiry setting. Do not expire a code you still need as your only recovery option.
Verify what is actually protected
If you regained access: connect to Wi-Fi, then open Settings → your name → iCloud → iCloud Backup → Back Up Now. Stay connected until it finishes and check the last-backup date/time. Apple’s iCloud backup instructions show that confirmation. Starting a backup is not the same as completing it.
If you remain locked out: check existing copies using another trusted device or computer you control. Apple explains how to locate computer backups. A connection may still require a Trust prompt or device passcode; a USB cable does not guarantee a new backup. Do not delete or overwrite an existing backup while investigating.
Also check the recent photos, contacts or files already available in the cloud services you use. iCloud syncing and device backup are different: information such as iCloud Photos is synced separately rather than duplicated in the daily backup. Seeing some cloud photos does not prove that every app or yesterday’s files are protected.
If an important item has no verified copy, keep the original phone unerased and explain that priority before agreeing to recovery work. A backup from before the missing files were created cannot be assumed to contain them.
Separate Passcode Reset from an erasing device reset
They are not a backup and are not the previous-passcode feature. Stop before confirming an erase if the data, backup, Apple Account access or cellular recovery plan is uncertain.
What if I only see Start iPhone Reset or Erase iPhone?
Apple’s on-device erase route requires supported software, a network connection, Find My previously enabled and the associated Apple Account/password. On iOS 17 and later, the route begins with Forgot Passcode?; iOS 15.2 or iOS 16 may show Erase iPhone. The previous-code feature itself starts with iOS 17.
Apple warns that confirming the erase permanently deletes device data and settings. Its no-computer reset guide also distinguishes eSIM handling: on iOS 17 or later an erase can offer keeping or deleting the eSIM; for iOS 16 or earlier Apple says to contact the carrier before resetting an eSIM device. This checklist stops before erase confirmation.
If on-device recovery is unavailable, Apple has a separate computer reset procedure with model-specific recovery buttons and Finder or Apple Devices instructions. That procedure erases the iPhone too. Do not reuse the Apple-logo troubleshooting guide’s Update step as a promised solution to a forgotten passcode.
Get help before an uncertain erase
Contact Apple when the previous-code route is missing or declined and important data is unverified. Have the model, known software version, approximate passcode-change time, exact message, displayed choices and backup dates ready. Keep passcodes and account passwords private.
Activation Lock is a separate check. Erasing does not promise a phone ready for another account. If that screen appears, use Apple’s Activation Lock support instructions. Apple directs business/school owners to IT and offers an ownership-support process with proof of purchase. Do not use another person’s credentials or an advertised lock bypass.
If a broken screen or unreliable touch is contributing to the lockout, arrange an iPhone assessment and state that data preservation comes first. An assessment is not a promise of unlocking the phone or recovering files. A borrowed or managed device should go through its owner or administrator.
Sources & scope
Official Apple instructions reviewed October 31, 2026. This is a source-based recovery checklist for a recently changed iPhone unlock code. It does not collect credentials, bypass a lock, perform an erase or guarantee data recovery.
- Previous-passcode recovery and eligibility · ending the grace period · passcode settings and failed-attempt consequences.
- Complete and check an iCloud backup · find existing computer backups · syncing versus backup.
- On-device erase conditions and eSIM warning · computer reset and model differences · Activation Lock ownership support. Erasing procedures are linked for informed planning, not required by this checklist.
Protect the original before any reset