Workflow Git & Workflow

Revert a Change

Safe workflow for reverting a problematic commit or merge

gitrevertsafety
CLAUDE.md

When reverting a change:

  1. Identify the commit(s) to revert. Use git log to find the exact hash.
  2. Create a revert commit: git revert <hash>. For merge commits, use git revert -m 1 <hash>.
  3. Run the test suite to verify the revert restores the expected behavior.
  4. Write a clear revert message explaining why the change was reverted.
  5. Push the revert and notify the team. Link to the original PR for context.
  6. 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.

get crystl