Mechanic by trade, software dev because it's fun as heck. And, well, it will be nice to WFH when I decide my body has had enough. No commute, A/C, less silica glistening in the early morning air!
While git log shows us the repository's public commit history, git reflog (or git reference log) shows us our workplace-specific local commit history.
I'll tell you why this is important.
Ever accidentally mess up a rebase and lose everything in the last few commits? You check you log and there's no trace of the last several hours worth of work to be found? Oops
With reflog, no problemo. It will shown you those commits you thought were gonezo. Run the command, identify the latest commit, make note of the branch tip and run:
git reset --hard my-branch-tip-before-rebase
A sanity saver, for sure. Learned from experiencing my own moment of panic.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Let me introduce you to git reflog!
While git log shows us the repository's public commit history, git reflog (or git reference log) shows us our workplace-specific local commit history.
I'll tell you why this is important.
Ever accidentally mess up a rebase and lose everything in the last few commits? You check you log and there's no trace of the last several hours worth of work to be found? Oops
With reflog, no problemo. It will shown you those commits you thought were gonezo. Run the command, identify the latest commit, make note of the branch tip and run:
git reset --hard my-branch-tip-before-rebase
A sanity saver, for sure. Learned from experiencing my own moment of panic.