Restore iPhone without upgrading OS
This probably doesn't work anymore
If you need to restore your iPhone you'll notice iTunes tells you that upon restoring it, the latest version will be installed. This will be just fine for regular iPhones of course, but for the people who have a Jailbroken iPhone, it's not ok (At least until the newest version is ready for jailbreak)
Well don't panic since this is a really simple thing to do, first, download the iPhone firmware you want to restore into. For my example I will use the iPhone 3.1.2, so get the IPSW (iPhone Software) and then move on to the next step.
Now that we have the IPSW ready simple plug your iPhone to your computer, and when it shows up on iTunes Hold down the Shift key and press Restore. You will be asked for the location of your desired IPSW file, simply select the one you just downloaded and click Open. Your iPhone should now be restored without problems to that version. This is also how you could downgrade your iPhone OS if you accidentally updated it.