你应该知道的10个Git命令(附链接)( 三 )

https://www.atlassian.com/git/tutorials/git-log

· git blame my_file——查看谁更改了my_file中的内容和时间 。

https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-blame

· git reflog——显示本地存储库HEAD的更改日志 。 这很适合找工作 。

https://www.atlassian.com/git/tutorials/rewriting-history/git-reflog

用Git检查事情并不是非常令人困惑 。 相比之下 , Git为删除和撤消提交和文件更改提供了大量选项 。

撤销事项

gitreset , git checkout和git revert用于撤消对存储库的更改的影响 。 这些命令可能很难保持直线 。

gitreset和git checkout可用于提交和单个文件上使用 。 git revert仅在提交级别使用 。

如果你只是处理尚未合并到协作远程工作的本地提交 , 则可以使用这些命令中的任何一个 。

推荐阅读