How to remove some commits from middle of git master branch?

This question already has an answer here:

  • Delete commits from a branch in Git 23 answers

  • git rebase -i ca83eb3
    

    When the interactive rebase happens, your text editor will come up. change pick to drop for the five commits you made. This will drop the commits from history after you save and exit the editor.

    Of coarse we could do some bash with logging the sha with only commits from you on that day, but since it is only 5 commits, let's just do this easy rebase.

    BUT:

    You should not do this. Now that your commits are public, every developer's code will have to be reset once you change history of their remote. Instead, consider leaving it, or making an additional commit that removes your code. You don't want to change history on public branches.

    链接地址: http://www.djcxy.com/p/9008.html

    上一篇: 从历史记录中删除单个提交

    下一篇: 如何从git master分支中删除一些提交?