jdx/mise · error

name the paths to roll back, or `--to

Error message

name the paths to roll back, or `--to <ref> --all` for everything the checkpoint covers

What it means

`mise dot rollback` requires you to say what to restore: either explicit file paths, or both `--to <ref>` and `--all` to restore everything the checkpoint covers. The command throws this when neither form is supplied (no paths, and not the full `--to` + `--all` combination), because it would otherwise have no idea what to act on.

Solutions

  1. Pass the paths to restore: `mise dot rollback path1 path2` (use `mise dot paths` to list tracked paths)
  2. Pass both flags to restore everything: `mise dot rollback --to <ref> --all`
  3. If you intended only `--all`-style rollback, first find the checkpoint ref from `mise dot history` and add `--to <ref>`

Example fix

// before
mise dot rollback --to checkpoint-42
// after
mise dot rollback --to checkpoint-42 --all
Defensive patterns

Strategy: validation

Validate before calling

if (req.paths.length === 0 && !(req.to && req.all)) {
  throw new Error('provide paths, or --to <ref> --all');
}

Prevention

When it happens

Trigger: Calling rollback (CLI `mise dot rollback` or RollbackRequest via API) with `paths` empty and either `to` unset or `all` unset — e.g. `mise dot rollback` with no flags, or `mise dot rollback --to abc123` without `--all`.

Common situations: Users run `mise dot rollback` expecting it to restore the last checkpoint automatically; they pass `--to <ref>` but forget `--all`; scripts build a RollbackRequest but fail to populate `paths`.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jdx/mise@533346cc37 (2026-09-17). Data as JSON: /api/errors/7be037b15b76a2bc. Report an issue: GitHub.

Appendix: source

Thrown at src/system/history/replay.rs:115

    /// modes git cannot express, `0600` say), and for the directories
    /// above it.
    bits: Option<u32>,
    dir_bits: Vec<(PathBuf, u32)>,
}

/// One checkpoint and the paths to take from it.
struct Target {
    entry: Entry,
    paths: Vec<PathBuf>,
}

pub(crate) async fn rollback(req: RollbackRequest) -> Result<()> {
    ensure_enabled()?;
    if req.all && !req.paths.is_empty() {
        bail!("choose explicit paths or `--all`, not both");
    }
    if req.paths.is_empty() && !(req.to.is_some() && req.all) {
        bail!(
            "name the paths to roll back, or `--to <ref> --all` for everything the checkpoint covers"
        );
    }
    if req.to.is_none() && req.all {
        bail!("`--all` needs `--to <ref>`");
    }
    let (store, tracked, entries) = crate::cli::dotfiles::history::open().await?;
    let repo = store
        .repo()
        .ok_or_else(|| eyre::eyre!("rolling back requires git"))?;
    let live = live_tree(repo, &tracked)?;
    let paths: Vec<PathBuf> = req
        .paths
        .iter()
        .map(|path| normalize_target(path))
        .collect();
    for path in &paths {
        if tracked.entry_for(path).is_none() {

View on GitHub (pinned to 533346cc37)