您的位置:首页 > 其它

git reset /delete remote respository commit

2013-07-09 23:15 471 查看
git reset --soft HEAD^ 撤销上一次提交,修改的文件还在git reset --hard HEAD^ 撤销上一次提交,修改的文件被还原delete commit alread push to remote respository:First, remove the commit on your local repository. You can do this using
git
rebase -i
. For example, if it's your last commit, you can do
git
rebase -i HEAD~2
and delete the second line within the editor window that pops up.Then, force push to GitHub by using
git
push origin +master
or:
git push -f origin <branch-name>delete middle commit like this:git rebase --onto <remove-commit-sha> <branch-name>

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: