Skip to content

Mistake in the new "git restore" section? #1533

@Fabien-jrt

Description

@Fabien-jrt

The "undo things" section mention that:

"It’s important to understand that git restore --staged <file> is a dangerous command. Any local changes you made to that file are gone — Git just replaced that file with the most recently-committed version. Don’t ever use this command unless you absolutely know that you don’t want those unsaved local changes."

I realised that the warrning added is more about the git restore <file> command.
Indeed, this command throw away my local work.

The git restore --staged <file> command, however, unstage the file in question.

The only thing I found about it is this comment, originally posted by @HonkingGoose in the pull request conversation.

Do I missed something?
Do we need to remove the --staged flag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions