Answer the question
In order to leave comments, you need to log in
How to pull revision from github?
The situation is simple. I've committed the code fix to the repository. Then I edited the code and decided to roll back to that committed version. Doing a git pull -- System says "everything is up to date". I suspect because I haven't committed any of this code yet.
How can I just roll back to the previous state without making this commit?
And how is fetch different from pull?
Answer the question
In order to leave comments, you need to log in
... I decided to roll back to that committed version.
git pull = git fetch + git merge
That is, pull is getting new data from origin (fetch) and merging it with the current branch. fetch simply fetches new data (commits), but doesn't merge it into the current local branch.
Rollback to the previous commit (if you did not commit unnecessary changes, that is, resetting the changes): git checkout HEAD . (dot - part of command)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question