If you have backed up your device to either icloud or itunes, then you'd have to perform a reset followed by a restore.
Go to Settings>General>Reset and tap Erase All Content and Settings. This will erase your device. Then you will go through the setup screens again as you did when your device was new, and when given the option, select Restore from iCloud Backup.
This link gives another overview of backup and restore: