0

On a shared feature branch, I've checked out the branch and inadvertently rebased it to master, causing a slew of problems as it's a shared branch and I should have done git merge.

How can I revert this entire branch to be exactly the state of the branch in the repository?

Naftuli Kay
  • 82,570
  • 85
  • 256
  • 387

1 Answers1

1

If you have done it only locally you can switch to branch master, delete your local feature branch and checkout the remote branch gain:

git checkout master
git branch -d featurebranch
git fetch
git checkout -b featurebranch origin/featurebranch
user2304916
  • 7,582
  • 5
  • 37
  • 53