Switching

Expand all | Collapse all

Discarding uncommitted changes

Jump to Best Answer
  • 1.  Discarding uncommitted changes

    Posted 05-16-2011 09:05

    Hello,

     

    Quick question. If I inadvertently make some changes to the config and I want to discard those changes, do I just exit configuration mode? When I exit configuration mode with the changes be discarded from the candidate configuration? Or are there additional steps that need to be taken?

     

    Thanks in advance. 



  • 2.  RE: Discarding uncommitted changes
    Best Answer

    Posted 05-16-2011 09:14

    Hello,

    Do this _before_ exiting config mode

     

     

    rollback 0

     

     

    And then exit.

    HTH

    Rgds

    Alex



  • 3.  RE: Discarding uncommitted changes

    Posted 05-16-2011 09:32

    thanks for the reply, here is the output of a show|compare rollback 0

     

    root@switch# show | compare rollback 0

     

    [edit interfaces ge-5/0/19 unit 0 family ethernet-switching]
    -      port-mode access;
    +      port-mode trunk;
    [edit interfaces ge-5/0/19 unit 0 family ethernet-switching vlan]
    -       members VlanXX;
    +       members [ VlanXX YY ];
    [edit protocols]
    +   stp;
    so basically these changes aren't yet commited and will be discarded correct?  thanks again!

     



  • 4.  RE: Discarding uncommitted changes

    Posted 05-16-2011 09:42

    Yes - that is correct - rollback 0 replaces the "candidate" config (the one you are editing) with the active config (same as the boot config). You can also do rollback "n" where n = a prior active config. JUNOS stores up to 50 prior configs (6 on some platforms)



  • 5.  RE: Discarding uncommitted changes

    Posted 05-16-2011 09:46

    perfect, thanks.  i appreciate the insight. 



  • 6.  RE: Discarding uncommitted changes

    Posted 04-05-2018 17:47

    The sort answer to your question is yes, exiting config before committing will discard the candidate config. The answers given below are the cleaner way to achieve what you are asking though.