我无意间把错误的档案 写错给Git 基特,但还没有将承诺推进到服务器上。
我如何解除那些承诺?当地当地仓库?
我无意间把错误的档案 写错给Git 基特,但还没有将承诺推进到服务器上。
我如何解除那些承诺?当地当地仓库?
当前回答
如果存储库是在当地承诺的,但尚未被推到服务器上,那么另一种粗糙/佣人解决它的方法将是:
其他回答
使用使用git revert <commit-id>
.
要拿到身份证明,请使用git log
.
以下是网站:Oh shit, git!
.
这里有许多解密的秘方 如何在Git 中解决事情。其中一些是:
哦,该死,我需要改变 信息在我的最后一次承诺!
git commit --amend
# follow prompts to change the commit message
哦,我无意中把什么东西 给了主人 本来该在全新的树枝上!
# Create a new branch from the current state of master
git branch some-new-branch-name
# Remove the commit from the master branch
git reset HEAD~ --hard
git checkout some-new-branch-name
# Your commit lives in this branch now :)
通过下列方式查看日志来查找上次承诺的散列代码 :
git log
然后
git reset <the previous co>
IntellelliJIDEA 您可以按下打开 Git 的 Git 仓库日志平平+9,鼠标右键单击承诺列表中的某些标记,并选择:重置当前分支到这里....
如果存储库是在当地承诺的,但尚未被推到服务器上,那么另一种粗糙/佣人解决它的方法将是: