How to remove local (untracked) files from the current Git working tree

前端 未结 30 2135
死守一世寂寞
死守一世寂寞 2020-11-22 00:07

How do you delete untracked local files from your current working tree?

30条回答
  •  情深已故
    2020-11-22 01:00

    We can easily removed local untracked files from the current git working tree by using below git comments.

    git reset [--soft | --mixed [-N] | --hard | --merge | --keep] [-q] []
    

    Example:

    git reset --hard HEAD
    

    Links :

    1. https://git-scm.com/docs/git-reset
    2. How do I use 'git reset --hard HEAD' to revert to a previous commit?
    3. Reset local repository branch to be just like remote repository HEAD
    4. https://jwiegley.github.io/git-from-the-bottom-up/3-Reset/4-doing-a-hard-reset.html

提交回复
热议问题