How to revert a folder to a particular commit by creating a patch

后端 未结 2 383
不思量自难忘°
不思量自难忘° 2020-12-22 18:59

Here\'s my history for the folder \'somefolder\'

$ git log somefolder

commit 89cd
More changes to somefolder

commit ef47a
Updating somefolder and other stu         


        
2条回答
  •  甜味超标
    2020-12-22 19:27

    You can use git checkout to update your repository to a specific state.

    git checkout e095 -- somefolder
    

    As for your question about generating the diff, that would work too. Just generate the diff to go from your current state back to e095:

    git diff 89cd..e095 -- somefolder
    

提交回复
热议问题