git remove from stage code example
Example 1: git ignore remove
git rm -r --cached .
git add .
git commit -m "Removing all files in .gitignore"
Example 2: how to unstage changes in git
#unstage a single file
git rm --cached <filePath>
#unstage all staged files
git reset
Example 3: how to remove all files from staging area git
git rm --cached -r .
Example 4: remove file from stage git
git rm --cached <file>
Example 5: remove frmo staging git
git reset HEAD -- filename
Example 6: git file reset to head
git checkout HEAD -- my-file.txt