Undo change in git (not rewriting history)

前端 未结 4 1621
盖世英雄少女心
盖世英雄少女心 2020-12-05 01:57

I made a change in a script and committed it. Then I made a few other changes, and pushed them to a remote repository and such.

Then I realised that first change I m

4条回答
  •  遥遥无期
    2020-12-05 02:13

    Yes, you can use git revert for this. See the git manual section on this for more information.

    The gist is that you can say:

    git revert 4f4k2a
    

    Where 4f4k2a is the id of the commit you'd like to undo, and it will try to undo it.

提交回复
热议问题