Skip to content

Instantly share code, notes, and snippets.

@taea
Last active December 13, 2015 18:58
Show Gist options
  • Save taea/4958788 to your computer and use it in GitHub Desktop.
Save taea/4958788 to your computer and use it in GitHub Desktop.
git pull --rebaseしなきゃいけないのに間違えて普通のpullしてしまってコンフリクトした
$ git reflog

どこまで戻ればいいのか確認

9001e69 HEAD@{0}:  pull: Fast-forward
e163cdc HEAD@{1}: commit: work in progress
cc4f489 HEAD@{2}: commit: Fix design for footer
e60b062 HEAD@{3}: rebase finished: returning to refs/heads/master

pull してるのが HEAD@{0} なのでそこまで戻る

$ git reset HEAD@{0}  

git status でファイルが赤く表示されステージングはずれたの確認

$ git clean -f

不要なファイルが消える git statusで残った新規のファイルが表示→必要なければ rm

$ rm -rf hoge/*  

$ git statusそしてなにもなくなったのを確認したらrebase

$ git rebase origin/hogebranch  

git status でpull前の状態に戻のを確認したら pull --rebase やりなおし

$ git pull --rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment