【发布时间】:2016-05-05 08:37:08
【问题描述】:
我正在尝试将较旧的提交推送到 heroku/master,但如果我没记错的话 git push 会将本地 master 推送到远程仓库。所以我试图让我当地的主人与我的 HEAD 相匹配。
我正在尝试在不丢失我所做的提交的情况下做到这一点,因此我可能可以在需要时返回它们。
我尝试过的事情:
# this only set my HEAD on the wanted commit.
$ git reset --hard HEAD
$ git reset --hard 055c700
# this made a new branch called HEAD instead of my actual HEAD, which was a pain to delete afterwards
$ git checkout -B "HEAD" "master"
【问题讨论】:
标签: git heroku master git-reset