How to reset Nexus One back to Stock

This is a tutorial to restore the Nexus One ROM to Original Shipping Image

I am assuming you know how to use ADB and Fastboot as well as some basic OS knowledge be it DOS, OSX, or Linux.

This will do the followings to your Nexus One:
1. Reset your system files to the original system files.
2. Reset your kernel/boot image to the original shipping boot image.
3. Reset your recovery to original recovery (if you wish).

This will not relock your Nexus One. Once you unlock your phone, you are stuck for now.

This is for those of you who decided to flash a few different ROMs and want to restart from scratch.

You may get the Original Shipping Image from HERE or thru Modaco HERE. [22607 build]
MD5sum for the images is: bef86698cafc88ca03fff5758571d9d6 (per DroidDrop)

As before, if you mess up your phone or your computer, you are on your own. I take no responsibility on what you do with your phone or your computer.

Brendenk posted a nandroid back of his fresh image here If you don't want to do an actual factory restore, try this first. If you really really want to do it your way then...

Step 1. Disable backup my settings under privacy settings.

Step 2. unzip the original shipping ROM and put it somewhere you can find.

Step 3. Plug in Nexus One with USB to computer (enable usb and debug modes)

Step 4. adb reboot bootloader (which will boot into the bootloader)

Step 5. Confirm fastboot connection fastboot devices

Step 6*. fastboot erase userdata

Step 7*. fastboot erase cache

*If step 6 and 7 does not work, and if you have Amon_RA's recovery installed, you can do a factory data wipe from there.
Alternately, you can also do a factory data wipe within Android. Settings => Privacy Settings => Factory Data Reset.
Thanks to Brian and setzer715.

Step 8. Go to the directory that you stored your unzipped files.

Step 9. fastboot flash userdata userdata.img

Step 10. fastboot flash boot boot.img

Step 11. fastboot flash system system.img

Step 12. Skip to step 13 if you want to keep recovery (assuming you have a modified recovery such as Amon_RA's recovery). If not fastboot flash recovery recovery.img

Step 13. fastboot reboot

Step 14. After the system boots up and while setting up skip setting up with the google account and you can setup accounts later. This will prevent the phone from pulling down the previous settings (downloaded apps, wallpaper etc) from google.

Step 15. You are done. Enjoy.

Source: Modaco for the ROM Image and HTC for the Instructions.