Best way to COMPLETELY remove a jailbreak

Before iOS5 is released I plan to do a full wipe of my iPhone 4 and start a new, however, i have noticed that jailbreaks, even after Restores, tend to leave a little extra on the device. This "little" can slowly turn into a lot after multiple jailbreaks over time. In iTunes, my iPhone 4's Capacity is displayed as 13.4GB. Its a 16GB phone. Now I don't know if 2.5GB is being used by the iOS5 beta, but its kind of hard for me to believe that.

Does anyone know of a sure fire way to completely blast everything off of the iPhone and basically start stock fresh?
Restore as new and don't restore from backup. Choose which apps to install through iTunes and do all your settings from scratch.
Restore as new and don't restore from backup. Choose which apps to install through iTunes and do all your settings from scratch.

Exactly. There shouldn't be anything left on the devices because the stock firmware is exactly what goes onto your idevice.
One additional question: Do you do a "new" restore from the iPhone itself or via iTunes somehow?
Connect your phone to your computer, go to iTunes, go to the phone tab, click Restore and choose restore as new.
One additional question: Do you do a "new" restore from the iPhone itself or via iTunes somehow?

From iTunes. When you plug in your iPhone to your computer on the first screen within iTunes is the option to restore. As you go through the process avoid the restore from backup option if you want the iPhone to be clean of all your settings.
I have done all of that. Fresh restore of the phone, and as soon as I jailbreak and install apps like FolderEnhancer and LockInfo, all of my previous settings appear to still be in place. This is with NO restore from backup within iTunes.

I'll be trying it again soon, but it has been nagging me for the past couple of jailbreaks.
Try doing a complete wipe of everything from the phone under settings reset. Then try a new restore. Maybe that might work.

Original thread: https://forums.imore.com/threads/best-way-to-completely-remove-a-jailbreak.214893/