Skip to content

Instantly share code, notes, and snippets.

@Yama-to
Created July 18, 2015 09:53
Show Gist options
  • Save Yama-to/0f014f19c63a50d2a961 to your computer and use it in GitHub Desktop.
Save Yama-to/0f014f19c63a50d2a961 to your computer and use it in GitHub Desktop.
新しいブランチを作成してコミットすべき内容を既存のブランチでコミットしてしまった時のgitでの対処方(45秒) ref: http://qiita.com/Yama-to/items/73d46f4713ae1eb105b6
$ git log
$ git revert [commit/(ex:5dfbxxx000xx....)]
$ git checkout master
$ git merge [old_branch_name]
$ git checkout -b [new_branch_name]
$ git cherry-pick [commit/(ex:5dfbxxx000xx....)]
$ git log
$ git branch -d [old_branch_name]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment