Git – How to undo ‘git add’ before commit

To undo git add before git commit, do this

git reset <file>

In addition to afore-mentioned example, we can undo staging all files, without any file name. This is useful when there are too many files to be listed one by one in a reasonable amount of time.

git reset

Author: Wu Chia Chong

My main areas of interest are software architectures and software design methods, patterns, and new trends in software development.