GIT when you give the commit "stores" the state of your Workspace, what I imagine you did was create a branch, add several files, work on what you needed and commit right?
When he returned to the master branch git checkout master
git reverts everything back to the state of the branch you are entering, in the master case, which did not have the files that were added to the other branch.
I suggest you read the git documentation Branch (Branching) in Git - Branch and Merge Basics
To have in the master branch what was done in the other branch you need to merge the two branches, with git merge
, would be something like git merge meubranch
.
When you use the merge, superficially speaking, git analyzes what’s changed, files included, removed, and "merge" with your branch, so the two are in the same state.
One of the purposes of git is just that, you can navigate between the various states/commits, just to create a kind of life history of the files.
I don’t know if I could be clear enough.
You probably committed but didn’t push, check out the branch you were working on and check if the files came back, if they came back you can push or merge with the master branch.
– Math