1 # Rolling Back Configuration Changes {#sec-rollback}
3 After running `nixos-rebuild` to switch to a new configuration, you may
4 find that the new configuration doesn't work very well. In that case,
5 there are several ways to return to a previous configuration.
7 First, the GRUB boot manager allows you to boot into any previous
8 configuration that hasn't been garbage-collected. These configurations
9 can be found under the GRUB submenu "NixOS - All configurations". This
10 is especially useful if the new configuration fails to boot. After the
11 system has booted, you can make the selected configuration the default
15 # /run/current-system/bin/switch-to-configuration boot
18 Second, you can switch to the previous configuration in a running
22 # nixos-rebuild switch --rollback
25 This is equivalent to running:
28 # /nix/var/nix/profiles/system-N-link/bin/switch-to-configuration switch
31 where `N` is the number of the NixOS system configuration. To get a
32 list of the available configurations, do:
35 $ ls -l /nix/var/nix/profiles/system-*-link
37 lrwxrwxrwx 1 root root 78 Aug 12 13:54 /nix/var/nix/profiles/system-268-link -> /nix/store/202b...-nixos-13.07pre4932_5a676e4-4be1055