Download WugFresh's Nexus Root Toolkit (NRT) to your computer and connect your Nexus device by the usb cable to your computer. Open NRT, select your device and download the suggested files. On the main NRT screen select Current Status/ Soft-bricked/Bootloop, then select Flash Stock + Unroot (don't worry if you are not rooted), accept the next screen and under the Which factory image screen select Settings/ No Wipe Mode to retain your programs and data. Click Ok and follow the prompts, your OS will be restored to the factory image with all of your apps and data intact. Make sure that you select the correct device on NRT or you will end up losing all of your data.
Sent from my Nexus 7 using Tapatalk