LoginSignup
1
1

More than 3 years have passed since last update.

【Git】initial commitをミスった時に初回のcommitを取り消す方法

Posted at

あんまり起こり得ないことだが、初回のコミットをを取り消したい状況に出くわした。
普段commitを取り消すならば git reset --soft HEAD^ などで取り消せるのだが、なぜかそれができなかった。

方法

git update-ref -d HEAD

で初回のコミットがステージングされた状態に戻る。

参考という名の引用

1
1
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
1
1