这里是Git初学者。我做了一个git提交,然后尝试推送到源,但收到了一条关于远程包含本地没有的工作的消息,所以我运行了git pull,并立即意识到我犯了一个错误,因为我的远程设置到了错误的存储库。
所以我不得不解开拉力。我想我可以做git reset --keep HEAD@{1}来恢复到我在尝试推送到源之前所做的提交,但是当我运行git reflog时,它告诉我这个提交不知何故在我的头上,而HEAD@{1}是从源拉取的。
$ git reflog
a98fsjs (HEAD -> master) HEAD@{0}: commit: This is what I was trying
我承诺并推动。
然后,其他人在我的分支中更改了一些东西,并提交和推送。我试着拉,因为我想得到这些变化。
结果:
From servername
3de3ee5..4db9ed8 Andrea -> origin/Andrea
You asked me to pull without telling me which branch you
want to merge with, and 'branch.Andrea.merge' in
your configuration file does not tell me, either. Please
specify