Skip to content

Recommend Use of git restore When Working With Files#2187

Open
vermiceli wants to merge 1 commit into
git:gh-pagesfrom
vermiceli:patch-1
Open

Recommend Use of git restore When Working With Files#2187
vermiceli wants to merge 1 commit into
git:gh-pagesfrom
vermiceli:patch-1

Conversation

@vermiceli

@vermiceli vermiceli commented Jul 24, 2026

Copy link
Copy Markdown

Replaces git reset commands that deal with restoring files from the worktree or index with git restore.

I believe this better aligns with the documentation, in particular Reset, restore and revert

git-restore[1] is about restoring files in the working tree from either the index or another commit. This command does not update your branch. The command can also be used to restore files in the index from another commit.

git-reset[1] is about updating your branch, moving the tip in order to add or remove commits from the branch. This operation changes the commit history.

Replaces `git reset` commands that deal with restoring files from the working tree or index with `git restore`.

I believe this better aligns with the documentation, in particular [Reset, restore and revert](https://git-scm.com/docs/git#_reset_restore_and_revert)

> git-restore[1] is about restoring files in the working tree from either the index or another commit. This command does not update your branch. The command can also be used to restore files in the index from another commit.
> git-reset[1] is about updating your branch, moving the tip in order to add or remove commits from the branch. This operation changes the commit history.
@vermiceli vermiceli changed the title Update git commands for unstaging changes Recommend Use of git restore When Working With Files Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant