/undo
Undoes the last git commit, provided it was made by Aider.
/undo runs a git reset on the last commit, but only if that commit was made by Aider itself (Aider recognizes its own commits). This lets you specifically revert unwanted automatic changes without accidentally losing your own manual commits.
โ WHEN TO USE IT?
Aider's last change didn't solve the problem or broke something
/undo right after a failed fix, to go back to the previous state and phrase the request more precisely
Compare two alternative solution approaches
Have proposal A implemented, check the result, /undo, then try proposal B
โ WHEN NOT TO?
The last commit wasn't made by Aider (e.g. made manually)
/undo deliberately refuses to reset when the last commit wasn't made by Aider, to protect other people's work.
Better: Run git reset manually in your own terminal, fully aware of the consequences
Multiple Aider commits need to be undone
/undo only reverts the single most recent commit, not several at once.
Better: Call /undo repeatedly, or reset directly to an earlier commit hash with git reset
SOURCES
- Aider Docs โ In-chat Commands โ aider.chat