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
  • 87,710
  • 93
  • 269
  • 411

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,882
  • 5
  • 39
  • 53