Can't seem to discard changes in Git

后端 未结 20 1351
傲寒
傲寒 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:53

    I've had a similar issue, where it wouldn't allow me to discard files which either does not exist or has been changed. I use Visual Studio at work, and I found that this happens when switching branches while the app is running.

    git checkout and trying to discard did not help. It wouldn't work or it would just tell me that I do not have permission.

    Solution that worked:

    1. Go into Safe Mode
    2. Discard files

    Restarting is a pain, but this worked faster than trying out 100 things.

提交回复
热议问题