I recently discovered that, when merging into my branch, someone mistakenly undeleted a file I deleted earlier.
When I do a git log on the path to the deleted file, the delete and the merge that undeleted the file don't appear.
If I do:
git log deleted_sha..HEAD path_t开发者_开发知识库o_file
I can see there was one change (the source of the conflict that caused my delete to get clobbered). From here, it's easy to walk through the history until the bad merge.
What I'd like is a command to tell me in exactly what commit (i.e., the bad merge) the undelete happened.
This should give you just the merge commits that affected the file:
git log deleted_sha.. --merges -- path/to/file
精彩评论