I had the same problem with iphone 5, But I managed to find the answer:
Force restore mode
If your iPhone 4 is hanging with an Apple logo, or exhibiting some other software problem that prevents iTunes from recognizing it, you can force it into recovery/restore mode and then use iTunes to restore the software.
If the device is powered off, plug one end of your USB cable into the iPhone 4 and leave the other end disconnected. Press down on the Home button, and keep holding it down while you plug the USB cable into your computer. After 5-10 seconds, you should see a "Please Connect to iTunes" image on the iPhone 4, and iTunes should prompt you to restore the software; follow the prompts and the instructions given above.
If the device is powered on, hold down both the power and home buttons until the device reboots and displays the "Connect to iTunes" image (generally, 5-15 seconds).