However, it is possible to alter this behavior and stash untracked files with the right git stash save and push options. The trick is to use the --include-untracked option or for brevity, the -u alias ...
Community driven content discussing all aspects of software development from DevOps to design patterns. As for how not to undo a staged file in Git? Don’t use git reset and definitely don’t use git rm ...