A shortcut command that combines git add . and git commit -m [commit_message]:
-> git commit -am "easy peasy"
An even shorter method for creating an alias:
-> git config --global alias.ac "commit -am"
-> git ac "super efficient!"
Use the --amend flag to modify your last commit:
-> git commit --amend -m [commit_message]
Also use the --no-edit flag if you don't want to change the amended commit message:
-> git commit --amend --no-edit
However if you have already pushed your commits to remote, you need to lead a risky lifestyle and push your amended commit with the --force flag.
A nicer, more visual way to check your git log:
-> git log --graph --oneline --decorate
Checkout to the last branch that you were at but forgot its name:
-> git checkout -