我无意间把错误的档案 写错给Git 基特,但还没有将承诺推进到服务器上。
我如何解除那些承诺?当地当地仓库?
我无意间把错误的档案 写错给Git 基特,但还没有将承诺推进到服务器上。
我如何解除那些承诺?当地当地仓库?
当前回答
通过下列方式查看日志来查找上次承诺的散列代码 :
git log
然后
git reset <the previous co>
其他回答
#1) $ git commit -m "Something terribly misguided"
#2) $ git reset HEAD~
[必要时编辑文件]
#3) $ git add .
#4) $ git commit -c ORIG_HEAD
我发现这笔该网站描述如何撤销您在存储库中的承诺 。
一些命令 :
git commit --amend # Change last commit
git reset HEAD~1 --soft # Undo last commit
使用此命令 :
git checkout -b old-state number_commit