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

后端 未结 7 1792
一个人的身影
一个人的身影 2021-02-01 12:16

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 versio

7条回答
  •  别那么骄傲
    2021-02-01 12:57

    Update 2019: the proper command would be

    git restore -s @~1
    

    (to, for instance, restore files at their state in HEAD parent commit)

    That is because:

    • git checkout is too confusing, dealing both with branches and files.
      git restore only... restore files, since Git 2.23 (August 2019).
      No need for git checkout HEAD~ -- .
    • Git 1.8.4 introduced @ as a shortcut notation for HEAD.

提交回复
热议问题