How can I reset or revert a file to a specific revision?

前端 未结 30 2443
不思量自难忘°
不思量自难忘° 2020-11-21 11:23

I have made some changes to a file which has been committed a few times as part of a group of files, but now want to reset/revert the changes on it back to a previous versio

30条回答
  •  别那么骄傲
    2020-11-21 11:50

    1. Git revert file to a specific commit
    git checkout Last_Stable_commit_Number -- fileName
    

    2.Git revert file to a specific branch

    git checkout branchName_Which_Has_stable_Commit fileName
    

提交回复
热议问题