I had this interesting scenario where I did hard reset and force push to a commit. However I wanted one of the change from the lost commit. Once again, Git magic came in handy. Git never erases anything off its memory too soon. This magic spell as I call, is one of a kind and most git enthusiasts must know it by now. Introducing reflog We all know what you get when you do git log . Let me anyway spell it out, git log gives you a list of changes or in other words, commits available as of the moment in that local repository in the chronologically descending order. Similarly, git reflog gives you a list if changes or in other words, change history that happened in that local repository in chronologically descending order. For instance, if you have amended the same commit 5 times, you can choose to go back to the 3rd commit amend and restart your work from there. This situation is what I call as, Bring back from the dead Let us consider the following scenario, You w...
Quick tips gained through my experiences at work