Git Recovering Recovering from a lost commit

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

In case you have reverted back to a past commit and lost a newer commit you can recover the lost commit by running

git reflog

Then find your lost commit, and reset back to it by doing

git reset HEAD --hard <sha1-of-commit>


Got any Git Question?