Delete apps from previous Apple ID and set iPhone to factory seeting
To reset to factory settings, in your iPhone go to Settings → General → Reset → Erase All Content and Settings. It ask for confirmation twice.

To restore a previous backup, you have a couple of options:


Connect your iPhone to iTunes and you will see a Restore Backup... button on the iPhone Summary tab.
If you start your phone without iTunes, once you enter your Apple ID and password you will be prompted to restore a backup (if you have one stored on iCloud).