If iTunes is open, exit iTunes
Disconnect iPhone from computer USB
Click Start menu on desktop
Go to Control Panel
Go to Programs
Go to Programs and Features
Select Apple Mobile Device Support and click repair
Connect iPhone to computer USB (device should install automatically)
Open iTunes
When prompted, click restore iPhone
OS should install now and restore factory settings