[学習] Git基礎5-3

2018年5月20日日曜日

Git 学習

t f B! P L
- 「softでもhardでもHEADとブランチを付けたまま」――git resetで作業の取り消し (3/3):こっそり始めるGit/GitHub超入門(6) - @IT

直前のコミットを破棄する --headオプション

作業ディレクトリを指定コミット時の状態と一致させる

前回修正した「four」「five」の追記を破棄する
test@test-PC MINGW32 /c/www/test (master)
$ git reset --hard HEAD~
HEAD is now at a4e8c02 add two and three

test@test-PC MINGW32 /c/www/test (master)
$ git status
On branch master
nothing to commit, working tree clean

test@test-PC MINGW32 /c/www/test (master)
$ git log --oneline --decorate
a4e8c02 (HEAD -> master) add two and three
84e1082 first commit

test@test-PC MINGW32 /c/www/test (master)
$ cat members.txt
one
two
three

その他の記事

QooQ