Initialise Git and create a new repository or clone an existent one:

git init <directory>
git clone <repo> <directory>

Create a new branch and start working on it:

git branch <name-of-branch>
git checkout <name-of-branch>

Add all file changes in working directory to staging area:

git add -A

Commit changes:

git commit -m 'Message'

Inspect repository:

git status

Merge changes on a branch to master:

git checkout master
git merge <branch_name>

Inspect commit log:

git log
	or
git log --oneline

Undo changes:

git revert HEAD
	or
git checkout <previous_commit_id>
	or
git reset --hard <commit_id>

Amend commit:

git commit --amend

Push our changes to a remote repository: