Skip to content

Instantly share code, notes, and snippets.

@orumin
Created July 6, 2014 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orumin/d364dbd434cfe22ffcc2 to your computer and use it in GitHub Desktop.
Save orumin/d364dbd434cfe22ffcc2 to your computer and use it in GitHub Desktop.
2つ前のcommit消してremoteだけに変更を反映させた上で手元の変更は元に戻すやつ
git format-patch -1 HEAD~~ -o patch #2つ前のコミットからHEADまでをpatch/にpatchとして置く
git rebase -i HEAD~~~
#表示された中から要らないcommitの行を削除
git push -f #remoteにpush
git reset --hard HEAD~~ 消したコミットの直前まで戻る
git am patch/*.patch #patchを適用 & commit
#おわり
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment