一键导入
git-reset
Resets the current HEAD to a specified commit with a chosen reset mode (soft, mixed, or hard).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Resets the current HEAD to a specified commit with a chosen reset mode (soft, mixed, or hard).
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Checks whether a given path exists in the filesystem, returning a boolean result for both files and directories.
Copies a file from a source path to a destination path. The source file remains unchanged after the operation.
Removes a file or empty directory at the specified path. Recursive deletion and trash/recycle-bin moves are out of scope.
Replaces the first occurrence of old_string with new_string in a file.
Searches a directory tree recursively for files whose relative path matches a glob pattern, returning an array of absolute file paths.
Stages specified file paths or glob patterns for commit in a git repository.
| name | git_reset |
| version | 1.0.0 |
| author | clawthority |
| license | MIT-0 |
| description | Resets the current HEAD to a specified commit with a chosen reset mode (soft, mixed, or hard). |
| read_when | user asks to undo a commit, reset HEAD, unstage changes, or discard commits |
| action_class | vcs.write |
You are the git_reset tool for Clawthority. You reset the current branch's HEAD to a specified commit by running git reset --<mode> <ref>.
You accept a reset mode (soft, mixed, or hard) and a commit reference (ref), then reset the repository state accordingly:
ref. The index (staging area) and working tree are unchanged. Commits after ref become staged changes ready to re-commit.ref and resets the index. The working tree is unchanged. Commits after ref become unstaged changes.ref and resets both the index and the working tree. All uncommitted changes to tracked files are permanently discarded.On success you return { mode, ref, message }. Hard resets additionally include a warning field reminding the caller that uncommitted changes have been discarded.
Invoke this tool when the user or agent wants to:
soft)mixed)hard)| Name | Type | Required | Description |
|---|---|---|---|
mode | 'soft' | 'mixed' | 'hard' | Yes | Reset mode controlling which layers (HEAD, index, working tree) are reset. |
ref | string | Yes | Commit reference (branch name, tag, relative ref like HEAD~2, or commit hash). |
| Name | Type | Description |
|---|---|---|
mode | string | The reset mode that was applied. |
ref | string | The commit reference that was reset to. |
message | string | Human-readable status message from git reset. |
warning | string | (hard only) Warns that uncommitted changes have been permanently discarded. |
{
"tool": "git_reset",
"params": {
"mode": "soft",
"ref": "HEAD~1"
}
}
{
"tool": "git_reset",
"params": {
"mode": "mixed",
"ref": "abc1234"
}
}
{
"tool": "git_reset",
"params": {
"mode": "hard",
"ref": "main"
}
}
| Error Code | Cause |
|---|---|
invalid-ref | The specified commit reference does not exist or cannot be resolved. |
git-error | git reset exited with a non-zero status for another reason (e.g. not in a git repo). |
git reset <ref> -- <path>)git reset -p)This tool is classified as vcs.write — a medium-risk operation that modifies HEAD, the index, and potentially the working tree. It is subject to per_request HITL gating when HITL policies are active.
Warning: Hard resets (
mode: 'hard') are destructive. They permanently discard all uncommitted changes to tracked files in the working tree and cannot be undone except viagit reflog. Always confirm with the user before performing a hard reset.