- git stash: Records the current state of the working directory and the index, but want to go back to a clean working directory. The command saves your local modifications away and reverts the working directory to match the HEAD commit.
- git stash apply: Applies the stashed changes to the current branch you are working on. Does not remove the state from the stash list.
- git shortlog: Summarizes git log output.
- git commit --amend: convenient way to fix up the most recent commit. It lets you combine staged changes with the previous commit instead of committing it as an entirely new snapshot. It can also be used to simply edit the previous commit message without changing its snapshot.
- git reset --hard: Resets the index and working tree (throws away uncommited changes). Any changes to tracked files in the working tree since are discarded.
- git reset --soft: Does not touch the index file or the working tree at all (but resets the head to , just like all modes do). This leaves all your changed files "Changes to be committed", as git status would put it.
- git reset --hard HEAD~2: command moves the current branch backward by two commits, effectively removing the two snapshots we just created from the project history.
References:
- https://www.atlassian.com/git/tutorials/rewriting-history
- https://www.atlassian.com/git/tutorials/undoing-changes/git-reset
- git log --oneline
- git log --decorate
- git log --graph --oneline --decorate
- git shortlog
- git log --pretty=format:"%cn committed %h on %cd" (%cn = commiter name, %h = abbreviated commit hash, %cd = committer date)
Reference: https://www.atlassian.com/git/tutorials/git-log/formatting-log-output