Skip to content

flox rollback command


flox-rollback - rollback to a previous generation of an environment


flox [ <general-options> ] rollback [ <rollback-options>]


Managed environments evolve in atomic generations. Any change to a managed environment is tracked as a new generation. By default, flox activate will activate the latest generation.

flox rollback allows to reset the activated environment to an earlier generation. When called without arguments, flox will reset the default environment to the previous generation. A specific generation number can be provided using the --to GENERATION option.


Changes to a managed environment are always made to the currently active environment:

$ flox create -e demo               # Generation 1 ()
$ flox install -e demo hello        # Generation 2 ( hello )
$ flox install -e demo vim          # Generation 3 ( hello, vim )
$ flox rollback -e demo             # Generation 2 ( hello )
$ flox install -e demo emacs        # Generation 4 ( hello, emacs )


General Options

Many flox commands wrap Nix commands of the same name, and will correspondingly pass on options and arguments directly to the underlying nix invocation. For more information on the options supported by specific Nix commands please invoke flox nix <command> help.

The following options are used specifically by flox and must be specified before the <command> argument.

-v, --verbose
Verbose mode. Invoke multiple times for increasing detail.

Debug mode. Invoke multiple times for increasing detail.

-V, --version
Print flox version.

Print flox installation prefix / Nix store path. (flox internal use only.)

Force execution in flox-bash (flox internal use only.)

Environment Options

The following option is supported by environment commands:

(-e|–environment) <name>
Selects flox environment to be modified or used. If not provided then flox will fall back to using the default environment.


Which generation to rollback to If omitted defaults to the previous generation.