how to recover last commit after reset --hard

Recover that lost commit

In your repository, run git reflog (If you know what branch the commit was in, use git reflog <branch>)
Look for the commit message that went missing
Find the associated SHA, and run git show <sha>
View your missing code in all its glory
Use git cherry-pick <sha> to get that lost commit into a new branch

Comments

Popular posts from this blog

Fixing the DeepSpeed Import Error While Fine-Tuning the Qwen Model

Amazon Linux 2023 - User data configuration for launch templates to connect to the EKS cluster

How to create ISM policy and rotate logs in opensearch