delete first git commit

后端 未结 2 741
忘掉有多难
忘掉有多难 2021-02-09 00:47

I made a mistake when I first committed. I\'m on another person\'s computer and pushed a version with their user.name instead of mine. How can I delete this?

2条回答
  •  无人共我
    2021-02-09 01:03

    There are a lot of duplicate questions related to this. The following is a generic solution for replacing the first commit of your tree. After you perform this step, you can make any other changes using git rebase -i.

    Insert a commit before the root commit in Git?

提交回复
热议问题