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?
To jump back to a previous commit, first find the commit's hash using git log . This places you at commit 789abcd . You can now make new commits on top of this old commit without affecting the branch your head is on. Any changes can be made into a proper branch using either branch or checkout -b .
To check out an old state:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With