How to revert uncommitted changes including files and folders?

前端 未结 14 1824
小鲜肉
小鲜肉 2020-11-28 17:07

Is there a git command to revert all uncommitted changes in a working tree and index and to also remove newly created files and folders?

14条回答
  •  感动是毒
    2020-11-28 17:30

    One non-trivial way is to run these two commands:

    1. git stash This will move your changes to the stash, bringing you back to the state of HEAD
    2. git stash drop This will delete the latest stash created in the last command.

提交回复
热议问题