Before merging make sure that you have made commit to your changes. When you try to perform the merge, Git will write the result including conflicts into the working tree. And if you have uncommitted changes performing merge will destroy them, so Git aborts as not to cause you any data loss.
Now if you have committed your changes and the working tree is clean, then Git knows that you have saved your work and if you don't like the result of merge or conflicts you don't lose your data.
Here it is also possible to stash your changes, which will make your working tree clean. Now if the changes are logically on the branch you are on and you want to keep it then commit it or in case you want to work on it later or on any other branch then you can stash it. The choice is completely yours.
For more information on Git, you can join git training.
You can also check out: