To prevent Windows 11 from deleting your files after you turn protection back on, add the installation folder as an exclusion. Go to Windows Security > Virus & threat protection > Manage settings > Exclusions .