iPhone Factory Reset
Resetting iPhone, while Find My iPhone is quick and easy, erases all the data on your phone. If you have a backup of your data on iCloud or even on your computer, restoring it on your phone is not too difficult. If you don't have a backup, unfortunately you won't be able to access your phone without deleting it.
Just follow these steps:
Sign in to Find My iPhone with iCloud
Enter your Apple ID and password; you don't need an iPhone password, but you will need to access your Apple account
Select iPhone from the device drop-down list
Click "Remove iPhone" and confirm your decision
Now you can access your iPhone, generate a new code, and recover data