git blame, revert, diff, patch, gitk, git add --path, git add interactive, git reset HEAD

# who changed each line
git blame <file><rev>
# a gui interface
git gui blame
# reverse a commit and commit the result
git revert <rev>
# show a diff of unstaged changes
git diff
# show a diff with staged changes
git diff --staged
# show a diff of all changes since last commit
git diff HEAD
# make a patch
git diff > patchname.patch
# git gui
gitk
# interactively choose which changes to add to the index
git add --patch
# or you can use:
git add --interactive
# unstage files
git reset HEAD
# unstage specific files
git reset HEAD <path>

Internal References

Article Type

General