Delete all the local files and download a fresh copy from git

This question already has an answer here:

  • Reset local repository branch to be just like remote repository HEAD 18 answers

  • To remove the git commit which you have added locally do:

    git reset --hard HEAD^
    

    To remove the remove the uncommitted files, do:

    git clean -fd
    

    check out other git Clean options here:

    https://git-scm.com/docs/git-clean

    and then do

    git fetch
    git rebase origin/master
    

    or

       git pull
    
    链接地址: http://www.djcxy.com/p/26236.html

    上一篇: git冲突保持原有的上游

    下一篇: 删除所有本地文件并从git下载新的副本