0

There is a commit, pushed etc in the history of our repo. I have the SHA, and I would like to run the equivalent of git revert /one/folder/* THESHAID, but git revert doesn't look like it has the ability to change only a specific folder.

Is there a way to replicate that functionality?

4

1 回答 1

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
于 2014-04-18T00:01:01.570 回答