What is the safest way to undo running configuration in cisco switches and routers.
without reloading you can use:
copy startup-config running-config
In this way you copy the content of the startup config in the running config
In order to view the content of the startup config you can use the command:
I hope this helps.
copy startup-config running-config is not a reliable (or sometimes effective) way to remove changes made in the running config. The copy to running config does a merge of the two config files. Where the same command exists in both configs the command from startup will replace the command in running. But if a command exists in running and not in startup then it will still exist after doing the copy from startup to running.
Perhaps an example will help to clarify the issue. Lets assume that the startup config has interface fastethernet0/0 with an IP address configured and with no ip access-group on the interface and that access list 101 does not exist in the startup config. Then assume that you make changes in the running config by configuring:
access-list 101 deny ip any any
ip access-group 101 in
Then you realize that this is having a bad effect :(
so you do copy startup-config running-config. IOS does the copy but it will not remove access list 101 and it will not remove the ip access-group command. So you still have a bad thing.
In my experience the only effective way to be sure that changes are removed is to reload. I do not have experience with configure replace config but it sounds interesting.