Boots the switch with a factory default configuration.
Equivalent to a switch that ships from the factory. The switch has no configuration files, default user accounts, default security mode, Auto-sense-enabled ports, and performs a ZTP+ configuration after reboot. The 30-day factory license is also reset. If required, you must revoke the license file.

Note
unconfigure switch and boot config flags factorydefaults reset-all-files commands have the same behavior. For more information, see Enable Factory Default Behavior.
When you use the unconfigure switch command , it changes the value of the factory default flag in the show boot config flags command output to flags factorydefaults reset-all-files.
enable
configure terminal
unconfigure switch
Enable the factory default behavior using the unconfigure switch command.
Switch:1>enable
Switch:1#configure terminal
Switch:1(config)#unconfigure switch
Warning: Factorydefaults flag will delete runtime, primary and backup config files,
as well as local password files, authentication keys, and certificates.
Also, if you try to reset with a new image, it will not be loaded.
Federal and HiSecure modes will also be reset.
Ports will be configured with auto-sense enabled.
To undo this operation use "no boot config flags factorydefaults".