Check out example codes for "how to compare two commits in git". It will help you in understanding the concepts better.

Code Example 1

$ git diff 012345..abcdef

Code Example 2

-> git diff 0da94be  59ff30c > my.patch
-> git apply my.patch

Learn ReactJs, React Native from akashmittal.com