Can't seem to discard changes in Git

后端 未结 20 1385
傲寒
傲寒 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条回答
  •  旧时难觅i
    2020-11-29 21:52

    I was working on a libGDX project on Android Studio and I wanted to discard all the changes that I have done, and nothing was working for me, the solution I came up with was to commit all the changes into a new branch

    git checkout -b TRASH
    git add .
    git commit -m "discarded changes"
    git checkout master
    

    and then you can delete the TRASH branch if you want.

提交回复
热议问题