HEAD@{2}
:
refers to the 3rd listing in the overview of git reflog
查看最近的,4 条 git 历史记录
git log --pretty=oneline HEAD@{4}..HEAD
修改最近 2 次的历史
git reset --soft HEAD~2 && git commit --edit -m"$(git log --format=%B --reverse HEAD..HEAD@{1})"
打扫干净
git restore hahaha/Pods/Pods.xcodeproj/project.pbxproj
丢弃在工作区的修改
(use “git restore …” to discard changes in working directory)
强制提交
git push origin --force