How to find the branch you lost in Git

Published on

Dear future self,
I know how often you switch branches (isn't context switching the hardest thing) and loose the work you had been working on. To prevent you needing to find that StackOverflow question every time, this should help you find your missing branch:

git branch --sort=-committerdate


There might be a more useful way (if so will update this post) but for now it should help.

Kind regards,
Shane