git how to revert a git add code example Example 1: revert git add git reset <file> or git reset Example 2: undo git add but keep changes git reset -- FILE_NAME