git log
# Show all previous commit message and hash git log # Show the last n-commit message and hash git log -n
git reflog
# Look at the history of the git operations performed at `HEAD` git reflog # view detailed action history of all branches (incl. stash) git reflog -all
Squash every change up until current changes.
Create a new orphan branch at the tip (i.e. the most recent commit) of your current branch
git checkout --orphan new-master master git commit -m "new initial commit" # Overwrite the old master branch reference with the new one git branch -M new-master master