git accidentally added files code example Example 1: git remove added file to commint git reset file-name Example 2: how to unadd gitr file git reset HEAD myfile.txt