Can't seem to discard changes in Git

后端 未结 20 1404
傲寒
傲寒 2020-11-29 21:17

After seeing the following from the command line:

# On branch RB_3.0.10
# Changed but not updated:
#   (use \"git add ...\" to update what will b         


        
20条回答
  •  孤街浪徒
    2020-11-29 21:51

    I think you need to pass -f

    From the man page (man git-checkout, GIT-CHECKOUT(1)):

    -f, --force
    Proceed even if the index or the working tree differs from HEAD.
    This is used to throw away local changes.

    For instance, discard changes on the current branch and switch to a different branch:

    git checkout -f master
    

提交回复
热议问题