0

consider my master to an old version of the code that's not even important to me anymore as long as I have a branch called side_branch.

side_branch is up to date and has tons of differences compare to master

I did this:

git checkout side_branch
git commit -m "final version"
git push origin side_branch

git checkout master
git merge "side_branch"

got some conflict error and with some changes as following, the merge was successful:

git commit "ready to merge"
git merge "side_branch"
git push origin master

I think you got what is happing... as I realized I did a vice versa merge.

The problem is I don't have access (git log) to the most commits on the side_branch, as you may know now, I don't see the final version commit nor on the remote.

I read some similar issue on StackOverflow, so I did this:

git checkout "side_branch"
git merge "master"

Hoping to get other commits in the log, but It didn't help; so I thought before making the situation worse, Ask you, guys, to help a noobie.

what should do to get access to final version commit, and have this commit on my master branch?

Thank for your time.

Pedram
  • 557
  • 5
  • 17
  • 1
    Read this to get back to the right point: https://stackoverflow.com/questions/34519665/how-to-move-head-back-to-a-previous-location-detached-head/34519716#34519716 – CodeWizard Dec 08 '18 at 20:28
  • 1
    Use the reflog command as described in the answer – CodeWizard Dec 08 '18 at 20:29

0 Answers0