3

I am currently working on a project that has two main branches, stable(latest successful build) and unstable(experimentation). I created a new branch from unstable and have been regularly pushing commits from my local branch to the remote repository. Recently I used a git rebase command to get the latest changes in stable to my local branch. After the rebase, I made further changes to my branch and then committed it. On typing the following command git push origin "branch name", I received an error stating "local branch is behind remote branch". Due to my ignorance, I then did a git push -f. Once I typed this command I noticed that stable had reverted back to how it was 20 days back and all the latest commits were erased. But my remote repository has the latest changes. How to revert stable to how it was, beacuse the commits made by my colleagues have been erased.

user12222
  • 197
  • 2
  • 11

0 Answers0