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