You need to do a DFU Restore,
1. Connect the device to your computer
2. Shut down the device
3. Press the Power and the Home buttons at the same time
4. After 10 seconds release the Power button but continue holding the Home button
until you see a popup from iTunes saying "iTunes has detected an iPhone in recovery mode"
5. If you have been successful your device screen will be completely black/blank (this is 'DFU Mode')
6. You can now proceed and restore to the latest firmware using iTunes
This should fix your problem