You've rooted your Android device, flashed a custom ROM, and reaped the benefits of better power management, extra features, and the radiant glow that comes from treating that phone like you own it. Because you do own it, right? Now it's time to get a new phone. How can you make your old Android-powered hardware resalable?
How to restore your rooted Android to factory settings
We've got a way for you to restore the stock version of Android, thanks to the rescue guides at DroidForums.net. The procedure requires caution, because just like when you rooted your phone and installed a custom ROM, there's a chance you can brick it by downgrading, too.
Note that for these instructions, the phone being used is a first-generation Motorola Droid and that the steps are extremely device-specific. While the general idea of how to do it applies to all devices, you must research the exact instructions for your phone on your own.
The first step is to grab three downloads you must have to restore a Droid. One is the Motorola desktop tool for updating phones, called RSD Lite (download). Next, you want the appropriate drivers for your phone. In this case, I want the "Motorola Droid drivers" for a 32-bit computer (download). (Also available for download: x64 drivers.) The third download you have to have is the SBF file. In this case, I want to downgrade to Android 2.2 Froyo, so I search for FRG22D.sbf Droid (Google search results).
Next, install RSD Lite and the drivers, and connect your phone to your computer. Turn it off, then turn it on holding Up on the D-Pad. After a minute or so of holding it down, the Bootloader screen, a black screen with white text and no interface, will appear. Then run RSD Lite, and you ought to see your phone listed. If not, go to the menu bar, choose Config, then DeviceID, then choose either of the two options, and restart RSD Lite. Be sure to put the phone in bootloader mode before running RSD Lite.
Last, browse to the SBF file. Hit Start and grab a tasty beverage as Froyo installs. The phone should automatically reboot. If you connect it to a network, either with 3G or Wi-Fi, it will soon ask to upgrade to Android 2.2.1 or whatever the most recent manufacturer-supported Android version is.
That's one way you can restore your phone to its original, stock version of Android. There are several other methods out there, and remember that this procedure is nuanced and likely will change depending on your device.