What's the git equivalent of "svn update -r"?

34,877

Solution 1

git checkout HEAD~1

This will move your current HEAD to one revision earlier.

git checkout <sha>

This will move your current HEAD to the given revision. Use git log or gitk to find the revision you’re looking for.

Solution 2

And getting back to latest (equivalent to: svn up), you'll need to update the branch, usually:

git checkout master

This is because the HEAD refers to the version that is being checked out.

Solution 3

git pull 

seems a more appropriate command for what you are looking for

Share:
34,877
fratrik
Author by

fratrik

former programmer, current law student

Updated on July 09, 2022

Comments

  • fratrik
    fratrik almost 2 years

    I'm a recent git convert. It's great to be able to use git-svn to keep my branches locally without disturbing the svn server. There was a bug that existed in the latest version of the code. I wanted to establish a time when it worked so that I could use git bisect. I couldn't find the right command to move back in time. Thanks.