简体   繁体   English

Git:“git reset --hard HEAD”没有撤销一些更改

[英]Git: some changes weren't reversed by `git reset --hard HEAD`

I made changes in my project, then did git reset --hard HEAD , but I notice that some of the changes are still present.我在我的项目中进行了更改,然后做了git reset --hard HEAD ,但我注意到一些更改仍然存在。 When I run git status I get Your branch is behind '<my branch>' by 1 commit, and can be fast-forwarded.当我运行git status时,我得到Your branch is behind '<my branch>' by 1 commit, and can be fast-forwarded.

Can anyone explain this message, and advise me on how to approach it so that I can undo all the changes that I made after my previous commit?谁能解释这条消息,并建议我如何处理它,以便我可以撤消我在上次提交后所做的所有更改?

In order to go back one commit and overwrite the remote, you can为了返回一个提交并覆盖远程,您可以

git push --force

Provided that you are happy with the state of your repository on your local machine.前提是您对本地计算机上的存储库状态感到满意。 Otherwise, just git pull to fast-forward.否则,只需git pull即可快进。

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

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