Check out example codes for "get back some commits git". It will help you in understanding the concepts better.

Code Example 1

git revert --no-commit 0766c053..HEAD
git commit

Code Example 2

# This will detach your HEAD, that is, leave you with no branch checked out:
git checkout 0d1d7fc32

Code Example 3

git revert {commit_id}'

Learn ReactJs, React Native from