upgrading iphone 4 to iOS 5
The kind folks behind http://iossupportmatrix.com have done the work to catalog all model identifiers (and also list the minimum and maximum versions of iOS for each model).

In your case, the iPhone 4 needs iPhone3,1_xxxx.ipsw



If you use a restore image, it wipes the device and loads that version of iOS. At that point, you could restore from an older or equivalent level OS backup or set things up newly by syncing content.