Google has made Android 5.1 official and that means Nexus updates. Factory images are starting to pop up on the developer page, so you can easily get your device back to stock no matter what unspeakable things you've done to it. All the images we have so far are linked below.
As long as you can access fastboot, you can flash the system image. There are also updated binaries with all the drivers needed to run ROMs on these devices. That's more important for developers, but the images will come in handy on occasion for regular users. You need an unlocked bootloader to flash a factory image, but you can use them to update your device as well as completely re-flash. Just remove the wipe command from the batch file and let it run.
Download the image for your device at the links below. We'll update this post as new system images roll in.
- Nexus 4: LMY47O
- Nexus 5: LMY47D, LMY47I
- Nexus 6: LMY47D, LMY47E, LMY47I
- Nexus 7 (2012 WiFi): LMY47D
- Nexus 7 (2012 3G): LMY47D
- Nexus 7 (2013 WiFi): LMY47O
- Nexus 7 (2013 LTE): LMY47O
- Nexus 9: LMY47X
- Nexus 9 LTE
- Nexus 10: LMY47D
- Nexus Player: LMY47D
Source: Nexus Factory Images, Nexus Binaries