git restore vs git restore --staged: which side each one resets
@alandev03▲ 0 net votes
'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.