0
0

More than 3 years have passed since last update.

Gitコマンド メモ

Posted at

コミット直後に戻る

addもcommitもしていない場合

git checkout .

これで、コミットした後に試行錯誤で試しながらコードを書いていたけど、やっぱなんもなかったことにしたい時に
使える

commitしたけど、前回のコミットに戻りたい

git reset --hard HEAD^

これは、コミットした後に別の処理を書いて、それもコミットした。だけどやっぱりこのコミットしたの必要なかったわってなった時に使える

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