How to go to previous commits in eclipse and egit

跟風遠走 提交于 2019-12-31 19:23:45

问题


I have a git android project managed in eclipse and some times i want to temporarily roll back my android project to a specific time and then build it and do stuff and then restore to the latest version. How is this possible?


回答1:


To check out an old state:

  1. Open the History view for the repository (Window > Show view > Other... > Team > History)
  2. Select the commit at the time you want
  3. Context menu > Checkout

When you want to go back, just select the commit where master is (or the branch you were working on before) and select Checkout again. Because there is a branch there, it will automatically check out the branch instead of the commit.

Note that you may also have to enable "Show All Branches and Tags" in the history to see master in the history view, see the section in the user guide about this.



来源:https://stackoverflow.com/questions/20199334/how-to-go-to-previous-commits-in-eclipse-and-egit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!