If you’d like to revert firewall rules to factory defaults on Windows 10 or 11, ask PowerShell to run the appropriate netsh.exe command:
PS> netsh advfirewall reset
Elevated PowerShell is required. The command will undo any changes you (or installation programs) have applied to the Windows firewall since you installed the operating system.