Resetting your iPhone 5 will remove all your preferences and settings, but information such as your contacts and calendars, and media such as your songs and videos, aren't deleted.
Resetting your iPhone
1. Choose General
2. Choose Reset
3. Tap Reset All Settings
Erase all content and settings
This resets all settings to their defaults and removes all your information and media on your iPhone by overwriting the data.
If you are sure you want to do this, here's how:
1. Connect your iPhone to your computer or a power adapter
2. Choose General
3. Choose Reset
4. Tap Erase All Content and Settings
You won't be able to use your iPhone while data is being overwritten. This can take up to two hours or more, depending on the model and storage capacity of your iPhone.