How to revert uncommitted changes including files and folders?

前端 未结 14 1751
小鲜肉
小鲜肉 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:43

    A safe and long way:

    1. git branch todelete
    2. git checkout todelete
    3. git add .
    4. git commit -m "I did a bad thing, sorry"
    5. git checkout develop
    6. git branch -D todelete

提交回复
热议问题