git_reset
Unstage all staged changes in a Git repository to revert them to the working directory, allowing you to modify or discard changes before committing.
Instructions
Unstages all staged changes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo_path | Yes |
Implementation Reference
- src/mcp_server_git/server.py:97-99 (handler)The core handler function that executes the git_reset tool logic: resets the Git index to unstage all changes.def git_reset(repo: git.Repo) -> str: repo.index.reset() return "All staged changes reset"
- src/mcp_server_git/server.py:40-42 (schema)Pydantic BaseModel defining the input schema for the git_reset tool, requiring repo_path.class GitReset(BaseModel): repo_path: str
- src/mcp_server_git/server.py:201-205 (registration)Registration of the 'git_reset' tool (name from GitTools.RESET) in the list_tools() method with description and input schema.Tool( name=GitTools.RESET, description="Unstages all staged changes", inputSchema=GitReset.schema(), ),
- src/mcp_server_git/server.py:70-70 (registration)Enum definition in GitTools where RESET is set to the tool name 'git_reset'.RESET = "git_reset"
- src/mcp_server_git/server.py:320-325 (helper)Invocation of git_reset handler within the main call_tool dispatcher.case GitTools.RESET: result = git_reset(repo) return [TextContent( type="text", text=result )]