One of the most commonly asked questions by iPhone users who want to jailbreak their iPhone is: "Is possible to recover if things go horribly wrong while trying to hack their iPhone?"
The answer to that question is "Yes" and the process to do it is called "ReVirginize" or Restoring your iPhone.
Another reason to revirginize the iPhone or iPhone 3G would be to revert the iPhone back to factory settings i.e. locked state if you wanted to take your jailbroken and/or unlocked iPhone to an Apple Store because of some hardware issue.
You can follow the simple step-by-step guide to re-virginize or restore your iPhone after the jump.