Skip to content

Instantly share code, notes, and snippets.

@mw866
Created December 27, 2021 06:14
Show Gist options
  • Save mw866/50bc352e73cea329576525476445a6b2 to your computer and use it in GitHub Desktop.
Save mw866/50bc352e73cea329576525476445a6b2 to your computer and use it in GitHub Desktop.
#git
## To hard reset a single file to HEAD:
git checkout @ -- myfile.ext
## Unstage an added file in Git
git reset HEAD path/to/file
## Check staged differences
git diff --cached
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment