English 中文(简体)
如何回头回来?
原标题:How to revert back in git?
  • 时间:2012-05-11 05:53:22
  •  标签:
  • git
  • revert

I revert my code to previous version, now I want to revert it back to my latest version. How can I do that ? Thanks

最佳回答

如下:

git checkout master

(或你回过来意味着什么?)

问题回答

?

您可使用<条码>git reset -soft YOUR_SHA,以指明欧洲航天局的具体承诺。 或简单的<代码>git 核对总码,如果你在“排泄物头”状态中遗失,则返回中。

答案确实取决于你目前的状况。

你可以通过个人参考(标签、分行、核对)的历史,例如HEAD@{1},这是你在此之前所检查的最后位置,你可以用<代码>gitlog-g-decorate-oneline

William Pursell pointed out git reflog, a much simpler command than git log, focused only on the work-history logs in .git/logs.

如果使用

那么,你的法典处于瘫痪状态,即不属于任何分支。 您只能做一个<代码>giteckout Branch_name ,以便使守则符合最新修订。


如果使用

届时,您可以清理你们的变革,然后,你们就可以清理你们的变革。

或如果你记得<代码>。 最新修订,





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签