It seems as though many people are having issues updating their iPhones to 4.2.1. They are getting the error code 1013 and are stuck at the iPhone recovery logo. This seems to be a common issue and is affecting many users. You can follow the discussion on Apple’s forums.
The first thing that you should do to try and fix the error is try to restore from a different computer. If that is not an option you can do some editing to fix the problem yourself until apple releases a fix.
To Fix Error Code 1013 From Windows:
1. Hit the Start menu then go to All Programs and then Accessories.
2. Open Notepad.
3. Click Open from the file menu.
4. Browse to Windows/System32/drivers/etc.
5. Make sure you select view all files.
6. Open the file called hosts.
7. Delete all lines that have “gs.apple.com”
8. Save the file.
9. Restore your device.
To Fix Error Code 1013 From OS X:
1. Click on the magnify glass in the upper right corner.
2. Type Terminal and then launch it.
3. Type sudo nano /etc/hosts and hit return.
4. Enter your password
5. Scroll down until you find “gs.apple.com” entries. Once the cursor is in front of the line type a # to comment it out. Do this if you see multiple entries.
6. Save the file by pressing CONTROL+O.
7. Exit the editor by pressing CONTROL+X.
9. Try restoring your iPhone again.