Create an installer for your version of Windows using the downloadable media creation tools from the Microsoft website. Your operating system may have been damaged by whatever it was that caused you to need a restoration to factory settings. If you were running Windows 10, then you will not need to activate it, as Windows 10 activates by identifying the hardware it was initially installed on.