LoginSignup
8
9

More than 5 years have passed since last update.

間違えてコミットを--amendで書き換えてしまった場合の対処法

Last updated at Posted at 2014-04-03
git reset --hard HEAD^

とやってしまいがちだが、reflogの機構を利用して

git reset HEAD@{1}

すると--amendする直前に戻れる。

参考リンク

8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9