You can save files before a factory reset in Windows Backup settings. Open the Windows Backup settings and navigate to the Backup option, you can save your files with File History or back up your files to OneDrive Cloud.