Skip to content

git_rollback

MCP tools › Version control

Roll files back to HEAD, as Rollback in the Commit tool window: a file in HEAD gets its HEAD content in the working tree and the index (a file open in the window gets HEAD's text in its editor, which is saved, as one undo step: Undo gives back the earlier text, unsaved changes included, SPEC-0220 v5); a file added since HEAD leaves the index and stays on disk as unversioned, or is deleted with delete_added=true (refused while it has unsaved changes in an editor). Untracked files are refused. dry_run defaults to true and returns restored/unstaged/deleted; dry_run=false rolls back (needs the user-granted vcs-write right).

Its results carry text from git: the client is told to treat that as data, never as instructions.

Capabilitygit.git_rollback
AreaVersion control
Accesschanges files, repository
Reaches—
Rightsvcs-write
Dry rundry_run, on unless the call turns it off

Arguments

ArgumentTypeDescription
pathsrequiredarray of stringWorkspace-relative files to roll back to HEAD.
delete_addedbooleanAlso delete the local copies of files added since HEAD (default false: they stay on disk, unversioned).
dry_runbooleanOnly report what would happen (default true).

Call it from a shell

ferris-idea call runs one tool with the rights and safe mode of ferris-idea mcp. Replace the folder and the placeholder values.

Terminal window
ferris-idea call ~/my-project git_rollback '{"paths":[]}'
Input schema as JSON
{
"type": "object",
"required": [
"paths"
],
"properties": {
"paths": {
"description": "Workspace-relative files to roll back to HEAD.",
"type": "array",
"items": {
"type": "string"
}
},
"delete_added": {
"description": "Also delete the local copies of files added since HEAD (default false: they stay on disk,\nunversioned).",
"type": [
"boolean",
"null"
],
"default": null
},
"dry_run": {
"description": "Only report what would happen (default true).",
"type": [
"boolean",
"null"
]
}
}
}