Skip to content

Unclear description of git restore -s vs git revert #1042

Description

@astroDimitrios

How could the content be improved?

In the Reverting a committ challenge there is a paragraph:

The command git revert is different from git restore -s [commit ID] . because git restore returns the files not yet committed within the local repository to a previous state, whereas git revert reverses changes committed to the local and project repositories.

Which is hard to understand, we are considering changing it to:

The command git revert is
different from git restore -s [commit ID] ..
git restore restores files within the local repository to a previous state,
whereas git revert restores the files to a previous state and
adds then commits these changes to the local repository.
So git revert here is the same as git restore -s [commit ID]
followed by git commit -am Reverts: [commit].

So it's clearer what the difference is between the two commands.

Which part of the content does your suggestion apply to?

https://swcarpentry.github.io/git-novice/05-history.html

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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