Git命令备忘录

  1. git checkout -- file repo -> work
  2. git reset HEAD --mixed repo -> index
  3. git reset HEAD --hard repo -> index + work

Fixup and Autosquash

If there is something wrong with a previous commit (can be one or more from HEAD), for example abcde, run the following command after you’ve amended the problem:

$ git commit --fixup=abcde
$ git rebase abcde^ --autosquash -i
Written on January 14, 2015