3 ms·
Staging a file with 'git add' shows a somewhat long informational message what's worth reading. It says that a file can be unstaged by issuing 'git reset HEAD <
by pajko 4y ago
Staging a file with 'git add' shows a somewhat long informational message what's worth reading. It says that a file can be unstaged by issuing 'git reset HEAD <file>'. The work tree is left unchanged.
'git reset <commit>' is also useful to "forget" the last <commit>..HEAD commits, but leaving the work tree as-is (for adding back the changes in a single commit, for example). This should not be done to walk back already pushed commits, or a force push will be necessary with all its consequences.