Few weeks back, I have started work on new feature and created local branch from master using below method:
- git fetch
- git checkout master
- git pull
- git checkout -b feature-1 master
Fast forward, other devs have made many changes mean while and it was merged with master branch. So i have went ahead and tried to merge the updated master branch changes into my local feature-1 branch. So i have done below:
- git fetch
- git checkout master
- git pull
- git checkout fearure-1
- git merge master
Now instead of conflict, it performed the auto merge for few files and i have lost my changes in it. So what should i do to prevent that? I want to keep my changes with the changes which is in master branch.