So, how to recover from being stuck at the apple logo without doing a full restore wiping everything ? If you have openssh installed so you can log in remotely you can fix it quite easily, as you get nearly 2 minutes of ssh access during the apple logo before the system freezes where you can log in for "emergency surgery".
If you don't have OpenSSH already installed then sorry, it's restore time...
As the device is trying to boot up but still at the apple logo, try to log in as root using ssh. You should find you are able to log in soon after the device is pingable on your wifi network, and you have a few minutes to complete the following steps in time.
For example from a mac, log in with:
ssh -l root 192.168.1.103
Where your iphone/ipods own ip address is substituted.
First we will disable the watchdog timer (by temporarily moving its files elsewhere) and then reboot:
mv /System/Library/SystemConfiguration/mobilewatchdog.bundle/ /
reboot
After a few seconds the device will start to reboot, and after approximately 3-6 minutes (depending on how many apps you have installed) you will reach the lock screen as normal, when that happens we now have to re-enable the watchdog timer, and reboot again, so again log in with ssh, and type:
mv /mobilewatchdog.bundle /System/Library/SystemConfiguration/
reboot
You should find your iphone / ipod touch will reboot normally a second time.