You can probably tell who did this! When you reinstall, as the commits are overwritten, the commit information will be from the person doing the rebase, not the original author. (This is separate from the authorโs information.)
You can see this information in gitk (in the differences area in the lower left corner) or in the output of git log --pretty=fuller (as more complete than complete). Log output example:
commit b8624718b97a39a04637c91ec3517c109f3f681d Author: Original Author < original@author.com > AuthorDate: Sun Aug 8 02:15:10 2010 -0300 Commit: New Committer < new@committer.com > CommitDate: Mon Jan 23 17:29:39 2012 -0800 a lovely commit message ...
The name of the committer, email address, and date are the operation that actually wrote the commit. Please note that if it has been overwritten several times, you will have the latest information.
As for where it was reinstalled from ... if the original version of the reinstalled commits is also in your history, it's simple. Just search for the full history for the corresponding commit, for example, with a commit message snippet or something that has been changed in commit:
git log --all --grep='commit subject from a rebased commit' git log --all -S'void this_function_was_added() {'
If you no longer have an initial fixation in history, it will be tougher. I hope you can find out by tracking the person who did this, and if they donโt know it, asking them to run git reflog show <branch> in their repository to view the history of this thread.
source share