It seems these days many hardcore fans of Android root their phone as soon as they get it. The Nexus One is no exception, especially with Cyanogen by your side. But what are you to do when you have rooted your phone with a custom ROM on the Nexus and need to send it back because something happened? Well have no fear if you are looking for the way to put your Nexus One back to its original state.  I will walk you through the steps to set your N1 back to its original vanilla state.
** Just a fair warning, if something happens to your phone, i.e. you brick the thing. I’m not responsible for what you do to your phone.
The following steps are what we will do to your Nexus One.
- Reset your system files to the original system files.
- Reset your kernel/boot image to the original shipping boot image.
- Reset your recovery to original recovery
Please keep in mind, at this time there is no way to relock your nexus. Once you have unlocked your nexus it is as is. Â I have spoken to @Ryebrye and @PaulOBrien on twitter and to their knowledge they do not know of a way either.
So with all that being said here is a guide for how to return your Nexus One back to stock settings.
First you will need to have installed the latest Android SDK, which includes the USB drivers for windows for the Nexus One. Once you have this installed, add a folder path for the ADB utility to your System Environment Variables “path” variable.
Now lets grab the original shipping image. You can get it from two places; XDA or Modaco. (build 22607)
Step 1. Disable backup my settings under privacy settings.
Step 2. unzip the original shipping Rom.
Step 3. Plug in your Nexus One to your computer via USB. (Enable USB and debug modes)
Step 4. Open a Command Prompt on your computer
Step 5. Type adb reboot bootloader. This will boot into the bootloader.
Step 6. Confirm fastboot connection by typing fastboot devices.
Step 7. Erase your Userdata by typing fastboot erase userdata.
Step 8. Erase your Cache by typing fastboot erase cache.
*note, if step 7 and 8 do not work you can alternately do a factory data wipe within Android. Settings/Privacy settings/Factory Data Reset.
Step 9. Go to the directory where you stored your unzipped image file.
Step 10. Type fastboot flash userdata userdata.img
Step 11. Type fastboot flash boot boot.img
Step 12. Type fastboot flash system system.img
Step 13. “skip to step 14 if you would like to keep” your recovery image. This is assuming you have a custom recovery image installed. if not, type fastboot flash recovery recovery.img
Step 14. fastboot reboot
Step 14. After the system boots up, skip setting up with the Google account. This is so that your settings are not pulled down from Google. But if you want to, go ahead and finish setting up and you will be back to a Stock Nexus One.
Source: Modaco for the Rom Image and HTC for their Instructions.
A little heads up when your going to return your phone.
First. Â Remove the battery and battery cover. Second keep your SIM card and SD card. Third make sure that you’ve done a full wipe as listed in the steps above. A full wipe will clear all of your data.