how to go back to previous commit github code example
Example 1: git roll back to specific commit
cd projectname
git log --oneline
git checkout abc1234 .
git add -A
git commit -m "Revert commit: abc1234"
git push
Example 2: git go back to previous commit
git checkout 12feg3435 #commit ID
Example 3: get back some commits git
git revert {commit_id}'
Example 4: how to go to a previous commit state
# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32
Example 5: git move back one commit
# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32