Check out example codes for "how to remove file changes in git". It will help you in understanding the concepts better.
Code Example 1
# Discarding local changes (permanently) to a file:
git checkout -- <file>
# Discard all local changes to all files permanently:
git reset --hard
Code Example 2
git checkout -- .
Code Example 3
git clean -df
git checkout -- .
Learn ReactJs, React Native from akashmittal.com