Unstage a file without changing its working copy.
git restore --staged <file>Unstage a file without changing its working copy.
git restore --staged <file>Unstage a file without changing its working copy.
git restore --staged <file>| Option / clause | Description |
|---|---|
--staged | Restore the index, removing the selected path from the staging area. |
--source <tree> | Choose the source tree or commit. |
--worktree | Restore the working-tree file as well. |
-- <path> | Separate options from the path list. |
Review a command and its target before running it. Commands that alter files, services, accounts, disks, permissions or databases may be difficult to reverse. Test in a safe environment and keep backups.