在我们的回购历史中有一个提交,推送等。我有SHA,我想运行相当于git revert /one/folder/* THESHAID
,但git revert看起来不能只更改特定文件夹。
有没有办法复制该功能?
答案 0 :(得分:1)
这很奇怪,毫不奇怪,它没有按钮,特别是当蛮力方法如此简单时:
git revert that_commit # do the whole revert
git reset --hard HEAD^ # in what turns out to have been a throwaway commit
git checkout HEAD@{1} -- one/folder # and just take what you want of the results