git checkout to latest commit code example
Example 1: how to check git changes before commit
git diff --staged
Example 2: git checkout commit
git checkout <commit>
Example 3: git checkout previous commit
git reset --hard HEAD~10
To rollback 10 commits back: