How to un-jailbreak an iPhone? - 1

My husband has a jailbroken iPhone 5 that he wants to restore because for the last few day the phone has not been working right. We have tried restoring it with iTunes but when the computer is half way through the restore a notification box pops up in iTunes saying its not getting a network connection. Also we have tried doing a compleat restore from the phone, in the settings section but when we do that the phone just gets that spinning circle and it won't turn back on until we hold the lock and home button for a few seconds. Then it turns back on but it's still the same as it was before the restart.

First off, if you're both adults, I'd expect you not to jailbreak, a sad sad thing that is. Second, here's how, wait for a software update, update it, and it'll automatically overwrite the jailbroken OS.

You must of jailbroke with evasion.
sorry there's no way to unjailbeak when you used that flawed program.
it will eventually brick it.

First, those other 2 people are completely wrong, You need to do this step by step. First, go to cydia, manage, packages, and one by one delete them by tapping on them then Download redsnow latest version, and click dfu mode (pwned), then you can try either one of these ways, if one doesn't work, try the other

1. With redsnow, download the ios 6.1.3 ipsw for iphone 5, then click restore on redsnow's extras features, and select that 6.1.3

2.Re-pwn your device, click shift restore on itunes (make sure you have lastest version) and click that ios 6.1.3