Skip to content

git reset と git restoreの使い分けについて教えてください。 #8

@m0sq1t0

Description

@m0sq1t0

質問

git reset と git restoreの使い分けについて教えてください。

質問場所と質問内容

演習24「変更を取り消す②」の記述について質問させてください。

P124「②ステージングを元に戻す」で、ステージングされている変更を元に戻す場合は"git reset HEAD"を使うように記述されています。一方で、同じページ内の"git status"コマンドの出力では、
(use "git restore --staged <file>..." to unsage)
と表示されており、ステージングを元に戻す際には、"git restore"コマンドを使用するように読めます。"git restore"ではなく、"git reset"を使用する利点はどのようなものでしょうか。ご教示いただけますと助かります。

よろしくお願いします。

補足事項

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions