Before making any changes to the configuration you need to run the command archive command to force IOS to make a backup copy of the current running-config. Once this is done, make any changes to the configuration. At this point you've either got a new running-config that you like and that works or you have created a problem and it's time to rollback through configuration replacement.
If you need to rollback the changes, you will need to do the following:
Router# configure replace scp://scpuser:scppasswd@scpserver/configuration1.cfg revert error time 5 Router#configure revert now Router#configure confirm
The configure revert now and configure confirm are both optional commands depending on how you configure the replace command and the outcome. For example if you are sure that you don't want to revert to the previous running-config typing configure confirm will make the change permanent and resets the timer set in the replace command. In the above example because we set the time 5 part of the command we must issue configure confirm within 5 minutes or IOS will automatically revert to the previous running config. If you find that you need to revert immediately to the previous config you run the configure revert now command.
As you can see, this can be good for making and rolling back changes as necessary. Theoretically you can also take a configuration file and edit it offline and then copy it back to the device with the changes. I say theoretically because you have to be very careful to meet the requirements of the IOS Configuration file in terms of indention.