git如何修改已提交的commit

详细请戳我

详细操作

改写单次commit
git commit --amend

删改排以及合并多个commit
git rebase -i <commit range>

获取历史版本的某个文件
git checkout <commit> -- <filename>

移动HEAD指针
git reset [--hard] <commit>

创建一个回退提交
git revert <commit>

强制push,覆盖原有远程仓库
git push -f <remote> <branch>

猜你喜欢

转载自blog.csdn.net/csm201314/article/details/80254835