How can I discard modified files?

后端 未结 10 746
甜味超标
甜味超标 2020-12-13 18:00

This is a Linux 2.6 kernel repository. I git clone it to my local host.

After that. I didn\'t make any change. But when I \"git status\". I found 13 modified files.

10条回答
  •  再見小時候
    2020-12-13 18:33

    If you would like to remove all the files and modifications that differ from your origin branch but would like to keep all the ignored files (ex. node_modules, .vscode, .idea etc..) the best choice is to combine these two commands:

     git reset --hard && git clean -f
    

    This will reset all modified files and will clean all the unstaged ones.

提交回复
热议问题