How to revert multiple git commits?

后端 未结 13 2573
被撕碎了的回忆
被撕碎了的回忆 2020-11-22 07:36

I have a git repository that looks like this:

A <- B <- C <- D <- HEAD

I want the head of the branch to point to A, i.e. I want B

13条回答
  •  长情又很酷
    2020-11-22 07:54

    If you want to temporarily revert the commits of a feature, then you can use the series of following commands.

    Here is how it works

    git log --pretty=oneline | grep 'feature_name' | cut -d ' ' -f1 | xargs -n1 git revert --no-edit

提交回复
热议问题