从Git中的分支删除提交 - Delete commits from a branch in Git

问题:

I would like to know how to delete a commit. 我想知道如何删除提交。 git

By delete , I mean it is as if I didn't make that commit, and when I do a push in the future, my changes will not push to the remote branch. 经过delete ,个人意思是好像我没有进行该提交,而且之后进行推送时,所作的更改将不会推送到远程分支。 this

I read git help, and I think the command I should use is git reset --hard HEAD . 我读了git help,我认为我应该使用的命令是git reset --hard HEAD Is this correct? 这个对吗? spa


解决方案:

参考一: https://stackoom.com/question/5cGO/从Git中的分支删除提交
参考二: https://oldbug.net/q/5cGO/Delete-commits-from-a-branch-in-Git
相关文章
相关标签/搜索