It places them aside, installs a fresh copy of Windows, and puts them back where they were found. However, before erasing your Windows partition, Windows RE scans the hard drive for your files and personal settings. When you choose to keep your files, the same steps occur.
Windows RE erases and formats the Windows partitions before installing a fresh copy of Windows.The PC boots into Windows RE, the Windows Recovery Environment.When you reset your PC and remove everything: Microsoft has explained what’s actually going on under the hood here.
This process is very similar to reinstalling Windows from scratch or using a manufacturer-supplied recovery partition, but is more convenient. This will restore the original version that came with your PC–so if your computer came with Windows 8, and you upgraded to Windows 10, it will reset back to Windows 8. If your computer came with Windows pre-installed, you may also see a third option, “Restore Factory Settings”.