How to hard reset specific files in git?

This question already has an answer here:

  • Reset or revert a specific file to a specific revision using Git? 28 answers

  • If you just want to revert to the latest commit, try

    git checkout abc.txt xyz.txt
    

    If there's a specific commit you want to revert to, try

    git checkout <commit> abc.txt xyz.txt
    
    链接地址: http://www.djcxy.com/p/8978.html

    上一篇: 如何丢弃对一个文件的提交更改?

    下一篇: 如何在git中重置特定文件?