In our project we are using TFS server with git repository – we have seen some weird behavior that after some commit/push someone has override works of others but he was using only VS for this, and not command line. I suspect that VS used force option to override the changes but I don’t have prove for that. Is there any way to check log to see what happed and why changes were overridden?
-
best chance I see is to look for *orphaned commits* that used to be the old branch (see: https://stackoverflow.com/questions/2092810/browse-orphaned-commits-in-git) Of cause this does not work after `git gc` has been executed... – Timothy Truckle Jul 09 '18 at 08:23
2 Answers
This seems not related to TFS server hosted Git repo, more related the local repo. You could use git reflog
command to do the check option.
Reference logs, or "reflogs", record when the tips of branches and other references were updated in the local repository. Reflogs are useful in various Git commands, to specify the old value of a reference.
More details please refer the official tutorial.

- 49,478
- 5
- 35
- 62
TFS / VSTS has the ability to show the "branch updates" for a branch. Depending on the version you are using, this should be listed as "Branch Updates" or a "Pushes" tab on the web UI. I don't have a link to docs about this page, but hopefully that is enough to find it.
Another possibility for what happened is that there was an issue with how changes were merged on the client. Due to how Git simplifies history, it can make it appear as if the changes never existed in the branch. Here is a blog post on this topic:
Git lost my changes: Taking a look at Git's history simplification

- 1,682
- 13
- 9