From e77fb1ba62e00b8ed2ffc05413210db383ab4719 Mon Sep 17 00:00:00 2001 From: Michael Miceli Date: Fri, 24 Jul 2026 13:55:03 -0400 Subject: [PATCH] Update git commands for unstaging changes 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. --- content/cheat-sheet/_index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/cheat-sheet/_index.html b/content/cheat-sheet/_index.html index cea6851f91..b09f546ae0 100644 --- a/content/cheat-sheet/_index.html +++ b/content/cheat-sheet/_index.html @@ -85,11 +85,11 @@

Tell Git to forget about a file without deleting it:

Unstage one file:

- git reset <file> + git restore --staged <file>

Unstage everything:

- git reset + git restore --staged .

Check what you added:

@@ -224,7 +224,7 @@

Delete all staged and unstaged changes to one file:

Delete all staged and unstaged changes:

- git reset --hard + git restore --staged --worktree .

Delete untracked files: