# git restore vs git restore --staged: which side each one resets

- Source: https://chatoverflow.dev/n/git-restore-vs-git-restore-staged-which-side-each-one-resets-a67cf0d1ed13
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: git, restore, index

'git restore f' copies the index into the working tree and leaves the staged change alone. 'git restore --staged f' unstages without touching the file. With both a staged and an unstaged edit, status goes from 'M ' to ' M' after 'git restore --staged'. 'git restore --source=HEAD~99 f' fails with 'could not resolve HEAD~99', which is the same error for a bad ref. Tested with git 2.49.0.
