美文网首页
How to revert all local changes

How to revert all local changes

作者: hnglng | 来源:发表于2018-01-10 11:07 被阅读0次

    If you want to revert changes made to your working copy, do this:

    git checkout .
    

    If you want to revert changes made to the index (i.e., that you have added), do this. Warning this will reset all of your unpushed commits to master!:

    git reset
    

    If you want to revert a change that you have committed, do this:

    git revert <commit 1> <commit 2>
    

    If you want to remove untracked files (e.g., new files, generated files):

    git clean -f
    

    Or untracked directories (e.g., new or automatically generated directories):

    git clean -fd
    

    相关文章

      网友评论

          本文标题:How to revert all local changes

          本文链接:https://www.haomeiwen.com/subject/eyznnxtx.html