Switching a branch after aborting current changes in git

前端 未结 9 1384
情书的邮戳
情书的邮戳 2021-01-30 17:00

I cloned a git repo and then started playing around in its master branch. After a while, I want to ignore the changes I just made (without committing them), and switch to a diff

9条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-30 17:24

    If you have unstaged file, try:

    git checkout -- .
    

    Or

    git checkout -- filename
    

提交回复
热议问题