The message given by Git is the important one but it's more important to understand what it is saying beyond just the text on the screen.
Basically, this is the situation: In that remote repository, there are commits on the branch you tried to push to that you don't have locally.
Whether you originally avoided fetching them or they have been added into that repository after you last fetched from it is unimportant, the important bit is that they're there, and you don't have them.
So to answer your question, we cannot really answer your question of what is going to happen if you pull/merge those commits into your local repository.
The following scenarios are all possible, and there probably more scenarios conceivable as well:
- Those commits are completely unrelated to whatever it is that you're afraid of losing. Merging them in will add those changes to your local repository by adding new files, modifying existing ones or even removing some files.
- Those commits touch the very files you're afraid of losing, by modifying them. Whether the merge will succeed or not depends on what kind of changes in what areas of those files. It can turn into a merge conflict you have to resolve or the merge can go through just fine automatically.
- Those commits delete the files you're afraid of losing. If you've also modified the same files locally then you will have a merge conflict where you have to choose whether to keep the modified files or to delete them. If you haven't changed them locally then they will be deleted.
- Any mix of the above operations.
In short, it is impossible for us to tell you what the outcome will be.
But fear not, one of the big things I'm a fan of with Git is that you can experiment.
So do the following:
- Make a local clone or copy of your entire local repository
- In the copy/clone, add the remote you want to merge from as a remote
- Pull/merge in the changes from this remote, resolve any conflicts
Worse case scenario: You destroy that copy/clone. If you think you simply messed up, destroy the clone and try again. If you think the two repositories cannot be reconciled with a merge, you now have your answer as to what will happen.
Note that you do not really have to operate on a clone, you can clean up a botched merge in your real local repository, but I advise this anyway so that you're surer that you won't accidentally destroy anything important.