If you’re looking to sell your old smartphone, it’s a good idea to completely wipe its memory. Here’s a guide on how to perform a factory reset on each mobile operating system.
To restore your iPhone, make sure you have the latest version of iTunes installed. Launch iTunes and connect the iPhone. In the left column under “Devices,” click on your iPhone, then click on Restore in the Summary tab.
If you have trouble getting this to work, go to Apple’s official iPhone support page for more info.
A factory data reset can be done by going to Menu > Settings > Privacy > Factory data reset. More info here
Windows Phone 7
Go to Settings > About > Reset Phone. More info here
Go to Options > Security Options > General Settings > Menu > Wipe Handheld. More info here