This answer consists of instructions on how to find the answer.
Use the commit graph viewer (or just git log --graph , often best called as git log --graph --oneline --decorate --all ) to see where your particular commit is in terms of Git DAG. If the graph is good and linear, it will be easy to follow. If it is full of branching and merging operations, it will be harder, and probably someone did a bad merge that introduced the problem. If it is filled with unrelated branches, or even has only one unrelated branch, perhaps this is a problem.
(Using --all , you will see all labels, including all branch names, and with --decorate will be attached to the commits they point to. The --oneline parameter simply compresses the log output on a single line per commit, inserting much more into the text box.)
Use git show to view any regular (non-merge) commit: this shows you the commit metadata (author, time, log message) and runs git diff to compare the tree for this commit with the tree for that commit parent. For example, git show ABCD should show your change, since the tree you made changed the file compared to the tree you started from before you committed ABCD .
Assuming your ABCD commit is where you want it to be inside the chart, look at subsequent commits (using git show again) - subsequent commits are those closer to HEAD - to see who changed your change. Then you can try to figure out how they did it, perhaps by talking to them.
If the subsequent commit is a merge - commit with two or more parents - git show usually doesn't show you much, and you need to either use git show -m or run git diff manually to see two comparisons: from the first parent to this commit and from second parent to this commit. The -m flag tells git show to make two different differences for you. (You can provide -m for non-merge commits, it just does nothing for them. This is not the default, because merge usually shows a lot of redundant changes.)
(By the way, git log -- path does not actually show the history of files, because Git has no history in each file. Instead, this git log starts by finding all the achievements, going through the commit graph, starting with HEAD , but then issuing commits, which do not seem to affect the file.Itβs not clear why you donβt see ABCD commit here, but the version of the log graph and the output of git show should make this clearer.)
In the comments below: When describing the output of git log when checking commits marked 4 and 5 (when checking 5 we see 5, 4, 3, 2 and 1, but when checking 3 we see only 3 and 2), at least one of 4 or 5 should be a merger.
Assuming 4 is a (single) merge union, we can draw this particular piece of the graph as:
... <- 1 <------- 4 <- 5 <-- master / ... <- 2 <- 3 <--
Here, the ( master ) branch points to commit 5 , which is a regular commit without merging, while commit 5 points to commit 4 : 4 is the parent of 5 . Commit 4 - merge merge, merge the contents of commits 1 and 3 ; he has two parents, 3 and 1 (in some order). Commit 3 is not a merge with 2 as a parent. We know almost nothing about commits 1 and 2 : I drew them as if they have different parents, but maybe they have the same parent.
It is possible that commit 5 is a merge, or that 4 and 5 are both mergers; all you can say with confidence, based on 1 that appears when git log run from 5 , but not when git log run from 3 , is that 1 not in the history for 3 .
Please note that the story is found by following the arrows in the direction in which they are indicated, and never goes against the arrows. If we start with 5 and 4 is a merger, it has two outgoing arrows, so we go through both stories to get story 4 .
While git log --graph draws the story vertically (and does not put it in the arrows), it shows the same information that you cannot see without --graph , but which is vital for future operations, such as merges, which depend on the chart so far .
Note that if the above snippet of the graph is accurate (I still guess since you did not send git log --graph --oneline --decorate --all output snippets), then we can almost certainly tell what happened with your changes in commit 1 : who did the merge in 4 , told Git to destroy your changes, taking what was in commit 3 .