Julius Plenz – Blog

git: forget recorded resolution

Git's rerere is immensely useful. However, if you erroneously record a wrong conflict resolution, it's not entirely clear how to delete it again. The preimage file is stored under $GIT_DIR/rr-cache/some-sha1-sum/preimage, which is not a convenient place to look for that one wrong resolution if you have hundreds of them. ;-)

However, v1.6.6-9-gdea4562 introduced rerere's forget subcommand, which was not documented until recently (v1.7.1.1-2-g2c64034). So when rerere replays a wrong resolution onto your file, simply use git rerere forget path/to/file to forget the wrong resolution.

To (temporarily) replace the resolved version with the originial version containing conflict markers, use git checkout -m -- path/to/file. You can then issue a git rerere to replay the resolution again.

posted 2011-03-01 tagged git