My old phone has a broken screen, and it was the device I used for two-factor authentication on my GitHub account. I no longer have access to the authenticator and I also lost my recovery codes, so I cannot sign in from my new phone. Is there a way to reset two-factor authentication or recover the account and register 2FA again?
2 Answers
If you do not have the old authenticator or recovery codes, GitHub’s account recovery flow is the next step. Follow the instructions in its documentation and provide any verification details it requests.
First, check every device and browser you might still be signed in on, including an old laptop or the mobile app. If you find an active session, open your account security settings and generate new recovery codes or configure two-factor authentication on the new phone. If no session remains, try the official account recovery process; a previously authorized SSH key may also help verify ownership.

Unfortunately, I do not have an active session anymore. I was signed in before, but it logged me out unexpectedly yesterday, so I am trying to recover the account now.