I just upgraded to the iPhone 5 and plan on selling my old iPhone 4. However, I want to make sure I don't keep any personal information (photos, emails, contacts) on the device. Since both iPhones are synced with iCloud, I'm not sure that I am safe to just start deleting stuff without those same changes being synced to the new device. What is the appropriate way to clean up the old iPhone to be ready to sell?
Open Settings > General > Reset and choose Erase All Content and Settings.
This will wipe all personal data off the device (including all apps) and when it restarts it will be at the beginning of the wizard to set up a new device.
This will not effect any other devices linked to the same iCloud account, it purely clears the current device.
I didn't test it but I guess the easiest way would be to loose the connection to iCloud and then just reset it completely.
But I don't know if this is enough to clean it completely or if it would still be possible to regain the information through any kind of tools.