0

I have a project in which my master branch is ahead of backup branch. Due to some issues in code we want to use the backup branch as our gold copy and overwrite the same on master. Any suggestion what should be the better approach in this case? Merge or rebase? Also please provide the command to make things more simpler.

PS: It's ok to lose the current changes in master. Infact we have branch out of master as our reference

1 Answer 1

2

You should reset the master to point to the tip of the backup. Not do a merge or rebase.

git checkout master
git reset --hard backup
git push origin

Alternatively, you can revert everything that has happened after the backup commit.

Not the answer you're looking for? Browse other questions tagged or ask your own question.