Last active
May 15, 2024 05:40
-
-
Save naokazuterada/9e45a937f7574ebf91a7 to your computer and use it in GitHub Desktop.
git rebaseを間違えた時に元に戻す
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git reflog | |
# これで、以下の様なのが参照できる | |
2be6f11 HEAD@{0}: xxxxxxxxxxxx | |
18389ad HEAD@{1}: xxxxxxxxxxxxx | |
0c485c8 HEAD@{2}: xxxxxxxxxxxxxx | |
b751438 HEAD@{3}: xxxxxxxxxxxxxxx # ここに戻したいので一つ前の数字を指定↓ | |
hc8a0s8 HEAD@{4}: xxxxxx | |
# 「q」で戻って・・・ | |
git reset --hard 'HEAD@{4}' | |
# のように数字を指定すると元に戻る! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment