The Error Code 1013 or Error Code 1611 occur when you are restoring to a firmware lower than pre-exist on your iPhone. This has been a common issue across all iOS devices updating to iOS 4.2.1 and Apple Support Discussion forums are full of users complaining about this issue.
This bug has apparently been reported to Apple but if you don’t fancy waiting for an official fix, you can follow this guide to try and successfully update your iOS device to 4.2.1. Before doing so, you may also like to try and restore using a different computer.
How to Fix Error Code 1013:
Step 2. Now navigate to the “Utilities” folder.
Step 3. Launch "Terminal".
Step 4. Type "sudo nano /etc/hosts" (without quotes) and hit return.
Step 5. Enter your password
Step 6. Use the down arrow key to find the “gs.apple.com” entries. Once the cursor is in front, make sure you comment out the line(s) by entering “#” in front of the text.
Step 7. Save the file by pressing CONTROL+O.
Step 8. Exit the nano editor by pressing CONTROL+X.
Step 9. Restore your iDevice.