Connect to the console of the switch, after you made the connection reboot it. When you see the first line of the diagnostics you must hit CTRL-C. If done in time, that would take you to a menu, there select option "i" then option "a". After the bootup the switch should have been set back to factory default.