The Apple iTunes application allows you to restore your iPhone to its original factory settings, which erases all of your information. This feature is useful in the event your phone experiences problems loading due to an application conflict or errors from a recent firmware update. You can also restore your iPhone by using the phone's built-in reset feature. The reset feature provides the option to reset settings, or completely erase the phone's contents.
Press the "Home" button on your iPhone, and tap the "Settings" icon on the main screen.
Tap the "General" tab and tap the "Reset" tab.
Tap "Reset All Settings" to restore the iPhone to its default settings. Tap "Erase All Content and Settings" to restore the iPhone to its original factory settings, which erases all of your information including bookmarks, SMS messages, contacts and music.
Tap "Erase iPhone" to confirm the action.