补充git相关命令
git log:查看仓库的历史版本
git log --oneline:加上这个参数可以更加简洁查看仓库历史版本
之前的git简易总结
git reset --soft





git reset --soft总结
git reset --soft回撤,是回撤commit,文件内容其他是不变的
git reset --hard



git reset --hard总结
git reset --hard回撤,是回撤commit,同时本地仓库文件内容也会变。所以谨慎使用
两个命令相同之处是都是操作本地仓库,不影响远程库
git revert
还没有搞清楚,之后会写上去
补充回撤版本写法
- 可以写版本号,用git log就可以查到
- HEAD 最近一个提交
HEAD^ 上一次提交
HEAD^ ^ 上一次的 上一次的提交(倒数第三次)
HEAD^^^ 倒数 第四次的 提交
- HEAD~0 最近一个提交
HEAD~1 上一次提交
HEAD^2 上一次的 上一次的提交(倒数第三次)
HEAD^3 倒数 第四次的 提交
网友评论