git_reflog
Show reflog entries for any ref to recover lost commits after resets or branch deletions and trace HEAD history.
Instructions
Show the reflog for a ref (default HEAD), recording every local HEAD movement even after branch deletions or resets. Use this to recover lost commits after a reset or branch delete, and to answer 'where was HEAD before?'. Best for: recovering lost commits and understanding HEAD history. Returns: 'Showing reflog entries for .' followed by reflog text, or 'No reflog entries found.'; pass ref to inspect a specific branch. Does NOT show regular commit history — use git_log for that; pair with git_reset to restore a commit found here.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Ref to inspect, defaults to HEAD | |
| max_count | No | Maximum number of reflog entries to show | |
| repo_path | No | Path to the git repository, defaults to '.' (the server working directory) | . |