How can I downgrade my iPhone firmware from iOS 4.0.2 to 4.0.1?

How can I downgrade my iPhone firmware from iOS 4.0.2 to 4.0.1?

Note that downgrading your iPhone firmware is only possible if you have saved your SHSH files. For those who prepared by taking this step before upgrading, see the following instructions to downgrade.

First download your SHSH files to your computer with TinyUmbrella.

1. Install TinyUmbrella.
2. Plug in your iPhone and run TinyUmbrella.
3. In TinyUmbrella select Advanced Options and choose 4.0.1 firmware.
4. Select Request Form -> Cydia and click Save My SHSH.

5. Now make sure you have the iOS 4.0.1 firmware on your computer. Download the 4.0.1 firmware files for your device here:

iPhone 4
iPhone 3GS
iPhone 3G

6. For the next step put your iPhone into DFU mode.
7. Using TinyUmbrella click Display SHSHs to check that your SHSH files were downloaded to the computer. If the SHSH files are there click Start TSS Server.
8. Now in iTunes hold the Alt (Option) key down on the Mac or Shift key in Windows while clicking on Restore. Select the 4.0.1 firmware from the dialog box.
9. The iPhone will restore. If errors pop up they can be ignored.
10. When the restore is complete select Kick Device Out of Recovery in TinyUmbrella to complete the process.

Your iPhone is now running iOS 4.0.1.