how to unstage a file in git before commit code example Example: git unstage file for commit git reset myfilename.txt