GitHub has a massive user base of over 70 million users as of 2021, expected to reach the 100 million mark by the end of 2025. It is most often used by programmers but can be employed for any project you share with others. You can also manage source code repositories, track issues, communicate with team members, plan projects using milestones and issue boards, and more. For that, you need an active GitHub account and problems arise when you need to recover it after losing access.
There’s a strong chance you may be incapable of logging in at some point in time. For example, you may lock yourself out of the account by being unable to remember your password or losing track of the email address you used. Whatever the reason may be, the issue requires an effective and prompt solution. Recovering a GitHub account is not difficult, but requires some work and hinges on precautions you took.
Forewarning about GitHub Account Recovery
Many people are affected by this problem, and most can restore their accounts. It all comes down to how often they attempted to regain their GitHub password and how quickly they completed the process after being inactive (locked out). If you have access to your recovery codes and haven’t used other methods, such as sending a password reset request, you can use them after you can no longer employ two-factor authentication.
Method 1: Use a Two-factor Authentication Recovery Code to Recover GitHub Account
The first technique involves the use of one of your recovery codes. You might have preserved your recovery codes to a password manager software or the “Downloads” folder on your machine. The default name for the file containing recovery codes is GitHub-recovery-codes.txt. Here’s how to enter it:
- Start logging in to GitHub and provide your username and password.
- After you fail to get in, select “Use a recovery code or request a reset” under “Having problems?”
- Next, type one of your recovery codes and click Verify.
Method 2: Authenticate Account using a Fallback Number or Security Key
If you don’t have access to your primary TOTP authenticator app or phone number, you can use a 2FA (two-factor authentication) code delivered to your fallback number to recover a GitHub account. Similarly, if you used a security key to set up two-factor authentication, you can employ it as a secondary verification method. Unsurprisingly, this technique isn’t as popular—most people avoid taking precautions until it’s too late.
Method 3: Recover Your GitHub Account via a Verified Device or SSH and Personal Access Token
Do you know your GitHub account password but don’t have access to your two-factor authentication codes or recovery codes? You may obtain a one-time password via email and start the validation procedure to recover your account for GitHub. For security reasons, using a one-time password to sign back into your account can take up to 3 business days. Therefore, GitHub won’t pay heed to any further requests you submit meanwhile. Also, if you use two-factor authentication but do not know your password, you cannot generate a one-time password. If you do, however, here’s how to proceed:
- Type your username and password on the GitHub login page.
- Under “Having problems?”, proceed to use a recovery code or request a reset.
- When you can’t, go to the right of “Locked out?”, and select “Try recovering your account.”
- Follow “I understand, get started” to request a reset of your authentication settings.
- To send a one-time password to all your account’s valid email addresses, pick “Send one-time password.” Only authenticated emails are viable for account recovery. If you’ve limited password resets to your primary or backup addresses, they’re the only ones you can use.
- In the “One-time password” section, enter the temporary password GitHub delivered to your Inbox.
- Verify your email address and opt for an alternative verification procedure:
- Have you previously logged into this account using your current device? If you want to use it to prove your identity, select Verify with this device.
- If you’ve previously created an SSH (Secure Shell) key for this account and wish to utilize it for verification, choose that option.
- Have you created a personal access token in the past? If you want to use it to confirm your identity, pick the Personal access token option.
Alternative Method: Ask GitHub Support Team for Help
If nothing worked so far, you can reach out to GitHub Customer Care like this:
- Go to the Contact GitHub Support page.
- Select Account or billing related issues.
- Enter your name, email, and the reason you’re appealing.
- Type the subject line and write your message to the support team.
- Solve the puzzle to confirm you’re human and forward the request.
A GitHub Support representative will analyze your application and email you a response in up to three business days. If they accept your request, you will be sent a URL to finish your account recovery procedure. If your proposition is denied, they’ll provide a link you can use to ask extra questions.