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