how to undo the changes without added in git code example Example 1: git undo all changes git reset --hard Example 2: git reset one file git checkout HEAD -- my-file.txt