staged changes git code example
Example 1: git discard staged changes
git reset HEAD
git checkout .
Example 2: git check staged changes
git diff --cached
Example 3: git stage
git add . (This stages all changes made in the repository)
git add <filename> (Stages the change made in the specific filename)