Restoring an iPhone that cannot be detected
To restore your iPhone, boot it into recovery mode and wipe it from there.

To boot your iPhone into recovery mode and restore it to the latest version of iOS supported by your iPhone:


Shut down your iPhone by holding the lock button.
Connect the USB end of your connection cable (presumably 30-pin by your software) to your computer but not to your phone.
After the iPhone is off, hold the home button as you plug in the 30-pin connector.
Your phone should start and iTunes should detect "an iPhone in recovery mode that must be restored before it can be used with iTunes".
Restore to the latest version of iOS that is supported by your iPhone (by iOS 4, I would assume an iPhone 3G, which supports versions of iOS &lt; 4.2.1)