If you've lost access to your account after enabling two-factor authentication, GitHub can't help you gain access again. Having access to your recovery codes in a secure place, or establishing a secondary mobile phone number for recovery, will get you back into your account.
At the bottom of the 2FA dialog, click Enter a two-factor recovery code to proceed using your code.
Depending on how you configured two-factor authentication, your authentication code will either be generated by an application or delivered to your phone via text message. You can choose to switch between delivery methods at any time.