Clone repository: git clone <repo url>
Check out branch: git checkout <branch>
Pull changes from remote: git pull
Stage current changes: git add .
Remove file from current commit: git rm <file>
Stage current in tracked files: git commit -a
Amend last commit: git commit --amend
Don't amend pushed commits!
Discard all local changes: git reset --hard HEAD
Discard local changes to a file: git reset --hard HEAD <file>
Show current changes: git diff
Push changes to remote: git push
https://gitlab.com/snippets/1906783