Tags

, ,

Today accidentally I reverted the git commit. The reverted commit had major changes in the code. Instead of redoing the changes again (that was my last option), I found a way to get the changes back.

  • List the reference logs

    git reflog

  • Find the commit hash
  • Merge the changes into the current branch using the hash

    git merge <hash>

Advertisements