# Safe git undo (/git--undo)

/git--undo is a Claude Code skill in the Code section. Checks your recent history and proposes the safest way to undo the last commit, merge, rebase or change, explaining it before running anything.

- Web version: https://skills.sgomez.dev/en/s/git--undo
- Section: [Code](https://skills.sgomez.dev/en/code.md)
- Author: Santiago Gómez de la Torre
- License: MIT
- Source: https://github.com/sgomez-dev/claude-skills/blob/main/skills/git/undo.md
- Updated 26 Mar 2026

## How to ask for it

- `/git--undo I committed by mistake, undo it`
- `/git--undo undo the last merge without losing my changes`
- `/git--undo explain how to safely revert my last git action`

## Install

macOS · Linux:

```
curl -fsSL https://raw.githubusercontent.com/sgomez-dev/claude-skills/main/install.sh | bash
```

Windows:

```
irm https://raw.githubusercontent.com/sgomez-dev/claude-skills/main/install.ps1 | iex
```

Claude Code plugin:

```
/plugin marketplace add sgomez-dev/claude-skills
/plugin install git-skills@claude-skills-collection
```

## Permissions

- Reads: `.git/**`
- Writes: —
- Runs: `git reflog`, `git log`, `git status`, `git reset`, `git restore`
- Network: No
- Destructive: Yes

## Author's description

Safely undo the last git operation with explanation

- [How we review this](https://skills.sgomez.dev/en/methodology.md)
