Introduction
Sometimes you add files to be saved in your next snapshot by mistake. The command git restore --staged helps you remove those files from the list of changes to save, without deleting the changes themselves.
When you accidentally added a file to the staging area but want to keep editing it before saving.
When you want to remove a file from the next commit but keep your changes in the working folder.
When you staged multiple files but decide only some should be saved now.
When you want to fix a mistake before making a commit by unstaging files.
When you want to check the difference between staged and unstaged changes.