how to revert back in git code example
Example 1: revert back to a commit git
git reset --hard 4a155e5
Will move the HEAD back to where you want to be
Example 2: revert git commit
git revert <the_commit_hash>
Example 3: how to revert to log in git
git revert --no-commit 0766c053..HEAD
git commit
Example 4: how to revert a git revert
git revert <commitHashOfTheRevert> # locate the hash the revert was done
#this will invert the changes made in that commit
#and preserve the git history
Example 5: how to revert commit in git
git checkout <commit hash>