0
0

More than 3 years have passed since last update.

git よく使うコマンド

Posted at

コミットのコメント上書き

基本
git commit --amend -m "新しいコミット名"

git commit -m "a"
git commit --amend -m "b"

ワークツリーの取り消し

git checkout (. or ファイル名)

ステージングの取り消し

git reset (ファイル名)

直前のコミット取り消し

ステージングされた変更は残る git reset --soft HEAD^
一個前のコミット地点まで戻る git reset --hard HEAD^

特定のコミット地点まで戻る

コミットのログ表じ git log
1)git reset --hard **********************************
そのコミット地点まで戻る。それ以降のコミットは消される

2)git checkout **********************************
そのコミット地点まで戻る。それ以降のコミットは消されない

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