Is it possible to unstage the last staged (not committed) change in git? Suppose there were a lot of files in the current branch, some staged, some not. At some point, some foolish programmer accidentally executed:
git add -- .
...instead of:
git checkout -- .
Can this programmer now unstage his last changes with some magical git command? Or should he have committed before experimenting in the first place?
git add
command, especially for the files that already had staged changes, and had some changes which were to be undone, not staged. Can't say the other question is not related though.