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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.