undo stage git code example
Example 1: git unstage file for commit
git reset myfilename.txt
Example 2: how to remove file changes in git
git clean -df
git checkout -- .
Example 3: revert unstaged changes git
git checkout -- .
git reset myfilename.txt
git clean -df
git checkout -- .
git checkout -- .