There are a couple of ways you can go about resetting a cisco switch back to its default state, however, I recommend this over doing a write erase.
Simply use the following commands to erase the running configuration and go back to factory state:
delete flash:vlan.dat
erase startup-config
reload