{"record":{"id":"a4243f981ae46263","repo":"gitbutlerapp/gitbutler","slug":"there-are-changes-that-differ-from-the-original-co","errorCode":null,"errorMessage":"There are changes that differ from the original commit you were editing. Canceling will drop those changes.\n\nIf you want to go through with this, please re-run with `--force`.\n\nIf you want to keep the changes you have made, consider finishing the resolution and then moving the changes with `but squash`.","messagePattern":"There are changes that differ from the original commit you were editing\\. Canceling will drop those changes\\.\n\nIf you want to go through with this, please re-run with `--force`\\.\n\nIf you want to keep the changes you have made, consider finishing the resolution and then moving the changes with `but squash`\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"crates/but/src/command/legacy/resolve.rs","lineNumber":619,"sourceCode":"        .collect();\n    paths.sort();\n    Ok(paths)\n}\n\nfn cancel_resolution(ctx: &mut Context, out: &mut OutputChannel, force: bool) -> Result<()> {\n    let t = theme::get();\n    // Check if we're in edit mode\n    let mode = operating_mode(ctx)?.operating_mode;\n    if !matches!(mode, OperatingMode::Edit(_)) {\n        // Not in edit mode, show the workflow help instead\n        return show_workflow_help(out);\n    }\n\n    if !force && {\n        let guard = ctx.shared_worktree_access();\n        !changes_from_initial(ctx, guard.read_permission())?.is_empty()\n    } {\n        bail!(\n            \"There are changes that differ from the original commit you were editing. Canceling will drop those changes.\\n\\nIf you want to go through with this, please re-run with `--force`.\\n\\nIf you want to keep the changes you have made, consider finishing the resolution and then moving the changes with `but squash`.\"\n        )\n    }\n\n    // Abort and return to workspace\n    abort_edit_and_return_to_workspace(ctx, force)\n        .context(\"Failed to cancel resolution and return to workspace\")?;\n\n    if let Some(out) = out.for_human() {\n        writeln!(\n            out,\n            \"{}\",\n            t.attention.paint(\"Conflict resolution cancelled.\")\n        )?;\n        writeln!(\n            out,\n            \"All changes made during resolution have been discarded.\"\n        )?;","sourceCodeStart":601,"sourceCodeEnd":637,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but/src/command/legacy/resolve.rs#L601-L637","documentation":"This error is thrown by `but resolve cancel` when canceling an edit/resolution session would discard work: the worktree currently differs from the state captured when the session started (changes_from_initial is non-empty) and `--force` was not passed. It protects the user from silently losing conflict-resolution edits. The message also points to `but squash` as the way to preserve the changes.","triggerScenarios":"Running `but resolve cancel` (cancel_resolution) after having modified the conflicted files or otherwise changed the worktree during the resolution session, without the `--force` flag.","commonSituations":"A developer enters conflict resolution, makes some manual edits, then decides to abort with `but resolve cancel`; the CLI refuses because those edits would be dropped.","solutions":["Review the changes; if discarding is intended, re-run with `but resolve cancel --force`.","If the edits should be kept, finish the resolution and move them with `but squash` as the message suggests.","Inspect the worktree (git diff / but status) to decide whether to force or keep."],"exampleFix":"// before\nbut resolve cancel\n// after\nbut resolve cancel --force","handlingStrategy":"validation","validationCode":"const initial = captureWorktreeState(); // at session start\nfunction canCancelSafely() { return diff(initial, captureWorktreeState()).length === 0; }\nif (!canCancelSafely()) { confirm('Canceling will drop changes; use --force to proceed'); }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check `but status` before canceling a resolution session.","Decide explicitly between --force (discard) and finishing + `but squash` (keep).","Avoid editing files casually during resolution sessions."],"tags":["cli","git","conflict-resolution","destructive-operation"],"backgroundTag":"destructive-operation-requires-force","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}