yashinomi / sysdev2020_advanced

0 stars 0 forks source link

Class 3. Exercise 9. log #14

Closed yashinomi closed 4 years ago

yashinomi commented 4 years ago

変更をなくさずにgit addを取り消す

yashinomi commented 4 years ago

変更を行う。

$ echo hogehoge >> hoge.txt
$ git add hoge.txt
$ cat hoge.txt
hogehoge
hoge
hogehoge

git add を取り消し。

$ git reset
Unstaged changes after reset:
M   hoge.txt
$ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   hoge.txt

no changes added to commit (use "git add" and/or "git commit -a")
$ cat hoge.txt
hogehoge
hoge
hogehoge
yashinomi commented 4 years ago

git checkout hoge.txtで戻した。