git-commands

  1. Pull from remote overwriting local changes
git stash # revert and stash changes locally
git pull  # pull from remote normally

2. delete only untracked files from working tree

git clean -f -d

3. Remove file from remote

git checkout branch-name
git log --online
git revert -m commit-id

4. Undo last n commits

git reset --soft HEAD^n # where n is the number of commits you want to undo

5. See differences between branches

git diff branch_1 branch_2