I'm really struggling to understand `git`, so here's a tighter rephrasing of a previous question I had asked. I'm going to explain a hypothetical scenario, detailing what I think happens when you download some code using `git` and install it on a machine, and hopefully somebody can tell me which part I am incorrect about!

1. I run `git clone git://github.com/foo/foo.git`
2. This creates a local directory `foo`, and downloads the source code and git data
3. This source code effectively contains all the versions of the software: source files, header file, and git data for the different versions
4. I run `git checkout release-1.0`
5. This tells my system that I want to deal with version 1.0 of the software
6. I run `make`, which compiles the code for version 1.0
7. This creates a library called `libfoo.so.1`
8. I run `make install`, which installs the library
9. This copies over `libfoo.so.1` into the directory `/usr/local/lib`
10. It also copies over the header file `foo.h` into the directory `/usr/local/include`
11. This header file is the version of `foo.h` that corresponds to version 1.0 of the software
12. I now also want to install version 2 of the software, so I run `git checkout release-2.0`
13. This tells my system that I want to deal with version 2.0 of the software
14. I run `make`, which compiles the code for version 2.0
15. This creates a library called `libfoo.so.2`
16. I run `make install`, which installs the library
17. This copies over `libfoo.so.2` into the directory `/usr/local/lib`
18. It also copies over the header file `foo.h` into the directory `/usr/local/include`
19. This header file is the version of `foo.h` that corresponds to version 2.0 of the software
20. I now try to create a project which depends on version 2.0 of the software, and link it to `libfoo.so.2` which is at `/usr/local/lib`, and include `foo.h` which is at `/usr/local/include`
21. This project compiles and runs fine
22. I now try to create a project which depends on version 1.0 of the software, and link it to `libfoo.so.1` which is at `/usr/local/lib`, and include `foo.h` which is at `/usr/local/include`
23. This project does not compile ok, because `foo.h` is the header file for version 2.0 of the software, not version 1.0.

So, the thing I am puzzled about is how you can have two versions of some software installed on your machine. The actual library files `libfoo.so.1` and `libfoo.so.2` are both created and can be linked to by two different projects, but there is only one version of `foo.h` installed on the local machine. Therefore, only the version which was installed the latest will have the correct header file, because the two versions require different versions of `foo.h`.

Please can somebody explain where I am getting confused? Thanks!