The following guide will help you flash stock Android on the Google Nexus 7 (2012). There may be many reasons for you to want to do this, whether you've soft-bricked your device, installed a custom ROM and want to return to stock Android or whether you want to upgrade/downgrade Android without waiting for an OTA update.
Step 1: Setup ADB and Fastboot
To flash stock Android, you'll need to download the required tools for your PC to communicate with your Nexus 7. The Android SDK includes these tools, and can be downloaded from the Android developer website.
developer.android.com/sdk/index.html
Step 2: Download the factory image
After downloading and extracting the Android SDK archive for your operating system you'll need to download the appropriate factory image for your Nexus 7 Wi-Fi (grouper) or Nexus 7 3G (tilipia), and your chosen version of Android.
developers.google.com/android/nexus/images
Step 3: Extract the factory image
Extract the factory image for your Nexus 7 and copy the Android SDK files located in platform-tools to the factory image folder where the bootloader and flash-all files are located.
Step 4: Enter bootloader mode
From a powered off state, hold down the Power and Volume Down buttons on your Nexus 7. An Android lying down should appear with Start in green text at the top of the screen. Connect your Nexus 7 to your PC via Micro USB. Verify that your PC can detect your Nexus 7 by opening a cmd/terminal and typing fastboot devices. If your Nexus 7's serial number appears, then you're ready to continue. If not, ensure your Nexus 7 Fastboot drivers are installed.
Step 5: Begin the flashing process
Open the flash-all file on your PC. A cmd/terminal window should open and display text such as erasing, sending and writing. Your Nexus 7 may reboot once or twice during the process. Flashing the factory image should only take 1-2 minutes on average.
Congratulations! If everything went correctly, your Nexus 7 should reboot and display the Android boot animation. If using Android 5.0 Lollipop or later, the Nexus 7 may display the boot animation for about 5-10 minutes.
Step 1: Setup ADB and Fastboot
To flash stock Android, you'll need to download the required tools for your PC to communicate with your Nexus 7. The Android SDK includes these tools, and can be downloaded from the Android developer website.
developer.android.com/sdk/index.html
Step 2: Download the factory image
After downloading and extracting the Android SDK archive for your operating system you'll need to download the appropriate factory image for your Nexus 7 Wi-Fi (grouper) or Nexus 7 3G (tilipia), and your chosen version of Android.
developers.google.com/android/nexus/images
Step 3: Extract the factory image
Extract the factory image for your Nexus 7 and copy the Android SDK files located in platform-tools to the factory image folder where the bootloader and flash-all files are located.
Step 4: Enter bootloader mode
From a powered off state, hold down the Power and Volume Down buttons on your Nexus 7. An Android lying down should appear with Start in green text at the top of the screen. Connect your Nexus 7 to your PC via Micro USB. Verify that your PC can detect your Nexus 7 by opening a cmd/terminal and typing fastboot devices. If your Nexus 7's serial number appears, then you're ready to continue. If not, ensure your Nexus 7 Fastboot drivers are installed.
Step 5: Begin the flashing process
Open the flash-all file on your PC. A cmd/terminal window should open and display text such as erasing, sending and writing. Your Nexus 7 may reboot once or twice during the process. Flashing the factory image should only take 1-2 minutes on average.
Congratulations! If everything went correctly, your Nexus 7 should reboot and display the Android boot animation. If using Android 5.0 Lollipop or later, the Nexus 7 may display the boot animation for about 5-10 minutes.