Restoring a Pixel to the factory image is a pretty straight forward operation if you are familiar with fastboot and adb. This guide assumes you have fastboot already installed and setup in your user path. If not you can refer to the following link for more information.
WARNING – THESE STEPS WILL DELETE ALL USER DATA OFF THE DEVICE.
https://developers.google.com/android/images#instructions
1. Download OTA Image
Go to the following link and download the Factory Image for your device
https://developers.google.com/android/images
Extract the file and then open a terminal or command prompt in that directory.
2. Boot up Pixel in recovery
You can do this with “adb reboot recovery” or with the volume key to boot into the Android boot menu.
3. Flash Image
On Windows you can flash the firmware with
flash-all.bat
Or on Linux
./flash-all.sh
Should take it a couple of minutes to complete.
Next we can lock bootloader with
fastboot flashing lock
You will need to confirm the lock on your phone.