I recently posted a guide on how to fix your iPhone 3Gs if stuck at the Apple logo, Recovery or Connect to iTunes logo. This applies if it happened to you after running the 4.2.1 jailbreak, and tried to reboot your phone after running Ultrasn0w to unlock the 6.15.00 baseband.
Before you start, your iPhone 3Gs must be at the "Connect to iTunes" logo. If the phone is at another state, do the following:
1. Press and hold the power (lock) and hold button until the phone screen turns black.
2. Your USB cable should already be on the phone, but not to the computer. Press and hold the home button and connect the phone to the computer.
3. iTunes will default the Connect to iTunes screen on your phone and we're good to go.
You will also need the following software and tools:
a) Up to date iTunes version
b) 4.2.1. Custom iOS Firmware (linked file will be updated later)
c) An original carrier SIM card (AT&T for instance)
d) Internet connection (believe it or not, people have tried to restore when not connected to the internet)
e) Pwnage Tool 4.1.3. Unlock Edition (in case you don't have the Custom Firwmare yet)
f) Original iOS 4.2.1 Software for 3Gs
g) Redsn0w 0.9.6b5 or 0.9.6b6
After you have gotten your phone at that screen we will need to proceed with the re-jailbreak and unlock the phone once again. It's pretty simple actually. Here's the steps to follow:
1) Get your iPhone to DFU mode. While at the "Connect to iTunes" screen, press and hold both the power and home button for 10 seconds. Release the power button and keep holding the home button. (iTunes should come with a message saying "iTunes has detected an iPhone in recovery mode...").
2) Hold the ALT key and click on RESTORE. Select the Custom 4.2.1. iOS firmware* made with "Pwnage Tool 4.1.3 Unlock Edition".
3) iTunes should start processing the recovery, a bar should be displayed on your phone showing the actual process.
4) Once completed, insert the original carrier SIM card into your phone and wait for iTunes to complete the activation.
5) If you had any backup for your iPhone, run the backup now. It may reboot the device later, bringing it to the original "iBrick" state.
6) Once the back up is completed, open Redsn0w and run the Jailbreak once again. At this point your phone should already have the iPad baseband, so it won't be needed.
7) Once the jailbreak finishes, you'll need to boot in "tether mode" from Redsn0w. If you're not familiar with the process, just open Redsn0w and select "Just boot tethered mode right now".
8) Your iPhone will reboot, open Cydia and update everything that asks to update.
9) Again, it will ask you to reboot. Run the "Just boot tethered..." thing again.
10) Once back to the phone, open Cydia and install Ultrasn0w. When the installation completes it will ask to REBOOT DEVICE. Here's where you DO NOT need to reboot. Just press the home button and your iPhone should be good to go as long as you don't let the battery die or reboot the phone.
The dev-team is currently working on a method that allows you to either downgrade your baseband version back, or untether your iPhone. For now, just follow the instructions and precautions.
Remember iTunes will sign a firmware for a determined amount of time. If a newer than 4.2.1. version comes up, avoid using this method until further notice.