how to unstaged file in git code example
Example 1: discard unstaged changes git
#For all unstaged files in current working directory use:
git checkout -- .
#For a specific file use:
git checkout -- path/to/file/to/revert
Example 2: git delete unstaged files
git clean -df
Example 3: how to unstage a commit
git reset HEAD~
Example 4: git unstage file\
# unstage file before commit
git rm --cached <file_name>
Example 5: Why are there two ways to unstage a file in Git?
git rm --cached <filePath>