How to find out when some part of a file was deleted in git?

I just found out that one of my test files is missing about 20 lines at the top.

I recently tried to master VIM, so it seems to me that I managed to delete these lines, even if I did not even notice, and then sent them to the repository.

Now the question is: what is the best way to find out when this happened? How can I find out when something was deleted?

+5
source share
1 answer

Find the revision of R where this line existed, then use

git blame --reverse $R..HEAD <file>

This will show you who deleted them.

​​, (, "test_database" ), , pickaxe , :

git log -Stest_database <file>
+5

All Articles