When you initially set up two-factor authentication you should have been given a set of 10 single-use passwords and told to store them somewhere safely for use if the authenticator on your phone was unavailable. Alternatively if you don't want to use one of them, log into your Google account before the reset and turn on SMS message authentication for two-factor.
You can then use one of those methods to log back into your Google account the first time after you reset your phone.
Once you're into your Google account go through the normal method to reset up the Google Authenticator for 2-factor and when you get to the point that it shows you the QR code that you can scan from your phone to set up your account, print out or save the picture of that QR code (obviously make sure you store this securely). If you ever reset your phone again, or want to set up the Authenticator app on another device, you can just re-scan that same QR code again, it seems to work every time, years apart.