If you want to return to stock after you have done numerous things to your Nexus 7 like flashing custom ROM; rooting it, unlocking it or just want to return to perform a hard reset (deleting everything), follow this guide.
First, make sure you have installed the ADB drivers for Nexus 7. If not, download them [link]. After that, download the factory image / firmware for your Nexus 7 [link].
Extract the image into the same directory as your ADB and Fastboot executable (\android-sdk\platform-tools). Plug your tablet in and fire up command shell on your computer and go to adb directory in it. Then type the following:
adb reboot bootloader
Now type these four commands.
fastboot flash bootloader bootloader-grouper-3.34.img
fastboot -w update image-nakasi-jrn84d.zip
Keep in mind you can also do a hard reset by following these steps:
1. Turn off.
2. Hold vol up/vol down/power on
3. Select Recovery using vol buttons and press power button
4. After several minutes, screen with red triangle will appear
5. Hold volume up and press return for menu to make hard reset
Recently, I have having battery issues and I had already rooted it to install the stock android web browser on Nexus 7. Rooting voids the warranty but after doing the aforementioned steps on my Nexus 7, it returned to stock and got my tablet repaired.
Also check out how to get flash player on Nexus 7.related queries: nexus 7 stock image, flash img nexus 7, recovery img from nakasi-jrn84d-factory download