Delete last commit in bitbucket

后端 未结 9 1334
隐瞒了意图╮
隐瞒了意图╮ 2020-12-12 10:17

I made a mistake and I don\'t know how to delete my latest push in the repository. I pull the latest updates of the app but it has conflicts and I push it to repository.

9条回答
  •  不知归路
    2020-12-12 11:14

    Once changes has been committed it will not be able to delete. because commit's basic nature is not to delete.

    Thing you can do (easy and safe method),

    Interactive Rebase:

    1) git rebase -i HEAD~2 #will show your recent 2 commits

    2) Your commit will list like , Recent will appear at the bottom of the page LILO(last in Last Out)

    Delete the last commit row entirely

    3) save it by ctrl+X or ESC:wq

    now your branch will updated without your last commit..

提交回复
热议问题