简体   繁体   English

回滚到上一个提交并在github上成为主要负责人

[英]Rollback to previous commit and make master head on github

I messed up something badly and need to go back to a previous commit. 我弄糟了一些东西,需要回到以前的提交。 I have looked around and tried lots of things with no success. 我环顾四周,尝试了很多事情,但都没有成功。 How do I go back to commit 8add545108ce1a0d6ffebe891c112bb89ccbbae5 and make it my master on github? 我如何回去提交8add545108ce1a0d6ffebe891c112bb89ccbbae5并使其成为github上的我的主人? I can make it master locally but can't seem to get it to sync up with github. 我可以使其在本地掌握,但似乎无法使其与github同步。

The possible duplicate is not helpful in any way shape or form. possible duplicate形式在任何形式上都不possible duplicate帮助。 I have already seen that and had no luck with it. 我已经看到了,没有运气。 I did not keep track of which 50 things I tried but I know that was one of them. 我没有跟踪我尝试过的50件事,但我知道那是其中之一。

This solved it for me, I had to play around till I got it to work though. 这为我解决了这个问题,但是我不得不四处游玩,直到我开始工作。

git revert --no-commit [commit]..HEAD

git commit -m "Revert back to [commit]"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM