How to recover a git commit that is reset or discarded

Calm down! You can get it back!

We can make all kinds of mistakes when we write code. It is normal to make mistakes, but we should know how to solve the problem efficiently. In this article, I will show you an efficient way to recover a git commit that is reset or discarded accidentally.

--

--

I’m a Software Developer (https://www.superdataminer.com) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lynn Kwong

I’m a Software Developer (https://www.superdataminer.com) keen on sharing thoughts, tutorials, and solutions for the best practice of software development.