GitHub Locked Out: Lost 2FA Device or Recovery Codes

Share
Workaround available Web, mobile Updated November 13, 2026Based on 3 user reportsHow we research

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. 1. Use a saved recovery code

    1. On the 2FA screen choose More options > Use a recovery code
    2. Enter one code from your saved file, often named github-recovery-codes.txt
    3. After signing in, generate a fresh set under Settings > Password and authentication
    Did this fix it?
  2. 2. Use a passkey

    1. If you registered a passkey on another device or password manager, use it at sign in
    2. A passkey satisfies both the password and 2FA
    Did this fix it?
  3. 3. Start account recovery with an SSH key or token

    1. On the 2FA prompt choose the account recovery option and Begin account or email recovery
    2. Enter the one-time password sent to a verified email
    3. Choose a verification factor: an SSH key or personal access token already on the account (SSH keys can be removed after long inactivity)
    4. Support reviews within about three business days; your old credentials still work in the meantime
    Did this fix it?
  4. 4. If you have no password

    1. Request a password reset email; the link expires after 3 hours
    2. Then begin the recovery flow
    Did this fix it?
  5. 5. If every method is gone

    1. GitHub Support cannot restore the account
    2. 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 quote
Fixed it? Share this guide

Other GitHub errors

All 11 GitHub errors and fixes →