- commit 到本地仓库
- 如果有未提交的代码,先隐藏:git stash
- 提交指定 commit(git reflog 查看提交的id)
#查找提交记录 git reflog #push指定分支及指定提交版本 git push <远程仓库名称> <commit id>:<远程分支名称>
例子:git push origin 92f03088:dev
(切记:这适用于自己开发的分支,push上去会覆盖分支所有代码,如果是合作开发使用要慎重)
4.弹出隐藏的代码:git stash pop
#查找提交记录
git reflog
#push指定分支及指定提交版本
git push <远程仓库名称> <commit id>:<远程分支名称>
例子:git push origin 92f03088:dev
(切记:这适用于自己开发的分支,push上去会覆盖分支所有代码,如果是合作开发使用要慎重)
4.弹出隐藏的代码:git stash pop