This OS X guide will teach you how to restore your iPhone 3GS to 3.1.2 instead of 3.1.3 using the SHSH details stored on Cydia for your 3GS.

This method also works to restore iPhone 3GS devices to 3.1.2 instead of 3.1.3 that have encountered an error with sn0wbreeze.

If you have already restored on stock Apple firmware 3.1.3 via iTunes this guide may leave your phone unable to connect to the network (the 3.1.3 baseband and 3.1.2 firmware may not work well together).

The first requirement is that Cydia has your SHSH details stored for 3.1.2. If you have opened Cydia and seen green text at the top "This device has SHSHs on file for iPhone OS: 3.1.2" then you can restore to 3.1.2.

You need to edit your host file to connect to Saurik's server instead of Apples to sign the 3.1.2 firmware when you restore.

To do this first download and install Smultron.
Snow Leopard

Download iPhone 3GS 3.1.2 firmware

Next look in your Apple Menu and find Go.