开发者

Git - rollback to a previous commit

I committed my work (note not pushed) in a known good state. I have since made unwanted local changes (without committing or pushing the开发者_如何学Pythonm). What is the command to undo these changes and revert to my previous commit state?

Please accept my apologies for the beginner question but the suggestions turned up by my googling seem arcane and I would like to be confident in my actions.


From Pro Git Commnuity book:

Fixing mistakes

If you've messed up the working tree, but haven't yet committed your mistake, you can return the entire working tree to the last committed state with

$ git reset --hard HEAD

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜