how to get rollback git commit changes code example
Example 1: how to revert a commit
git reset --soft HEAD@{1} # delete the last commit keeping the changes
git reset --hard HEAD@{1} # delete the last commit removing the changes
git push --force origin master # delete the last commit also on remote branch
Example 2: after checking out a previous commit go back to latest commit
git checkout <commit hash> # go to previous commit
git revert <commit hash> # revert action of going to previous commit