Revert a Change
Safe workflow for reverting a problematic commit or merge
CLAUDE.md
When reverting a change:
- Identify the commit(s) to revert. Use
git logto find the exact hash. - Create a revert commit:
git revert <hash>. For merge commits, usegit revert -m 1 <hash>. - Run the test suite to verify the revert restores the expected behavior.
- Write a clear revert message explaining why the change was reverted.
- Push the revert and notify the team. Link to the original PR for context.
- If the reverted change needs to be re-applied later, fix the issue on a branch and open a new PR.
Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.