I have ever met the same situation as you said, I think you can try the same way.First, you need to open “setting” option and navigate it to “common” selection, and then slide to the bottom and click “restore”. When you click “erasing all contents and settings” button in the next step, the iPhone system will prompt you for your password if you have set a password before. After you entering your password, the system will confirm it with you. At this time, you just need to click “erasing iPhone”. All of things will be OK after you doing that. During this period, the iPhone screen will show iPhone logo and progress bar. Because of the different iPhone versions and different data volume, the whole process needs a few minutes, even a few hours.