git
The list of most useful git commands (see also git cheat sheet)
commit all modified files: commit -am "message describing what is in the commit"
add a small change to the last commit (before pushing): git commit -a --amend
undo the last commit (before pushing): git reset HEAD~1
if you only want to add a small change in one file: git add <file>, git commit --amend
discard changes to a file in the working directory: git restore <file>
look at an earlier commit with hash a1b2c3d4e5f6: git checkout a1b2c3d4e5f6; go back to the last commit: git checkout master
if local changes are not commited, before checking out do git stash and git stash pop after
view difference between current state and the previous one: git show; between the state of the repository one commit in the past and its state three commits in the past: git diff HEAD~1..HEAD~3
view difference between current state and the previous one using diff tool, say, kompare: git difftool HEAD HEAD~ -t <toolname>
when pulling (and automatic merging) causes conflicts: resolve them and do git add <file>, git commit, close the message file
to see in which commint the lines M to N were last modified: git blame -L M, N file.tex