I forked a repository from some other person. I am working on a branch develop
on my forked repo. I check out a new branch from it named issue
. I did some changes in the new branch issue
and pushed it.
Then I realized that the develop
branch in the remote repo got updated, and so I pull the changed into my local branch develop
which just deleted some of the files. Now I want to merge those changes into the issue
branch.
- I did
git rebase develop
inside theissue
branch. But it said that it is already updated with thedevelop
branch. - I also tried pulling directly from the remote repo inside the
issue
branch, and it also said that it is up-to-date with that repo. - I tried
git merge develop
similar to therebase
command, and it also gave the same result.
I have checked that those files are already being tracked by git.
I don't want to manually delete those files.
I did git fetch origin develop
from the remote repo and then git reset --hard HEAD
inside the issue
branch, which deleted the changes I made in other files.
What is the problem here, and can someone suggest an alternative to this without losing changes and without creating a new branch?