git restoreってなんだ
不適切なファイルをgit addしてしまいました weblog % git add content/posts/git-restore.md weblog % git status On branch main Your branch is up to date with 'origin/main'. Changes to be committed: (use "git restore --staged <file>..." to unstage) new file: content/posts/git-restore.md こういった場合 git reset <FILE>を使ってunstagedにしていました が、上の例にもあるけど、git restoreを使えというサジェストが出ています そもそも気がついたときのログにはadd/rmのサジェストも出ています Changes not staged for commit: (use "git add/rm <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) git add/rm: commitされた内容を更新する git restore: working directoryの内容を破棄する という違いがあるようです 今回のように間違ってaddしてしまった場合は、git restoreの方が正しそうです。 試してみます。 ...