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