GitHub Locked Out: Lost 2FA Device or Recovery Codes
Quick answer
If you lost your 2FA device, sign in with a saved recovery code or a passkey. Without them, start GitHub's account recovery with a verified device plus an SSH key or token, and expect up to three business days of review.
Most likely fix: Use a saved recovery code
How to fix it
Try these in order — the most common fix is first.
1. Use a saved recovery code
- On the 2FA screen choose More options > Use a recovery code
- Enter one code from your saved file, often named github-recovery-codes.txt
- After signing in, generate a fresh set under Settings > Password and authentication
Did this fix it?2. Use a passkey
- If you registered a passkey on another device or password manager, use it at sign in
- A passkey satisfies both the password and 2FA
Did this fix it?3. Start account recovery with an SSH key or token
- On the 2FA prompt choose the account recovery option and Begin account or email recovery
- Enter the one-time password sent to a verified email
- Choose a verification factor: an SSH key or personal access token already on the account (SSH keys can be removed after long inactivity)
- Support reviews within about three business days; your old credentials still work in the meantime
Did this fix it?4. If you have no password
- Request a password reset email; the link expires after 3 hours
- Then begin the recovery flow
Did this fix it?5. If every method is gone
- GitHub Support cannot restore the account
- You can unlink the email from the locked account and create a new one
Did this fix it?
Symptoms
You cannot get past the two-factor prompt because the phone, authenticator app or security key is gone.
Why it happens
- Authenticator app lost with the phone
- Recovery codes were never downloaded or saved
- Security key or passkey is not available on the new device
This guide also covers
- github lost 2fa
- github recovery codes
- github locked out two factor
- github 2fa not working
Still not working?
If GitHub keeps failing, you're not alone. See every GitHub problem users report or the alternatives people switch to.
Need a custom web app or internal tool? Our small team builds it, on your domain or hosted by us. Price agreed together.
Get a quoteOther GitHub errors
- GitHub Permission Denied (publickey) Error
- GitHub 'Password Authentication Was Removed' Error
- GitHub Push Rejected: Updates Were Rejected (Non-Fast-Forward)
- GitHub Push Blocked: Repository Rule Violations (GH013 / Secret Detected)
- GitHub Push Rejected: File Exceeds 100 MB Limit
- GitHub 'Permission Denied' or 403 When Pushing Over HTTPS
- GitHub Actions Workflow Stuck in Queued / Waiting for a Runner
- GitHub Actions: 'Recent Account Payments Have Failed or Spending Limit Needs to Be Increased'