My iphone won't restore itself when connected to itunes?

When it is half way through restoring itself, it stops and says error 29

Did you recently have the battery replaced or do any other hardware changes?

You need to put the phone into recovery mode to fix this:

Step 1: Disconnect the USB cable from your iPhone, but leave the other end of the cable connected to your USB port.

Step 2: Turn off the iPhone: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.

If you can't turn off the device using the slider, press and hold the Sleep/Wake and Home buttons at the same time. When the device turns off, release the Sleep/Wake and Home buttons.

Step 3: While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.

Note: If you see battery pictured on the screen, let the device charge for at least ten minutes to ensure that the battery has some charge, and then start again with second step.

Step 4: Continue holding the Home button until you "Connect to iTunes" message flashes on the phone's screen.