git unadd a file code example Example 1: how to unadd gitr file git reset HEAD myfile.txt Example 2: undo add stage git git reset <file>