1be25fe に戻すには、次のコマンドを実行する必要があります。これにより、HEAD が 1be25fe に戻ります。次に、プッシュを実行して、そのアップストリームをプッシュできます。
git reset --hard 1be25fe # revert back to 1be25fe
git status #to check to see that it has reverted correctly, and see if there are any other issues.
git push origin stable #push the changes and recreated the branch upstream
// 編集
your 'tip' is behind エラーを回避するには、-f
パラメーターをプッシュに追加します。このパラメーターは、リモート リポジトリでの変更を強制します。私は以前に同じ問題を抱えていましたが、完全に機能しました。
git push -f origin stable
// 編集 2
実際にコミットを削除したい場合は、リベースを検討する必要があります: http://git-scm.com/book/en/Git-Branching-Rebasing
// 編集 3
変更を 4b2b148 にマージするには、次の手順を実行する必要があります。
git checkout -b important_changes origin/stable # branch off from the current state
git cherry-pick 4b2b148 # retrieve the commit containing the changes and insert it ahead of 1be25fe
git checkout stable # switch back to the older branch
git merge important_changes # merge in the important changes
git commit -am 'merged important changes' # commit the changes
git push origin stable # push the branch to master
git branch -d important_changes # remove the temp branch.
important_changes
警告: と の両方をマージすると、マージの問題が発生する可能性がありますstable
。押す前に、それらが固定されていることを確認してください。