Skip to main content
deleted 115 characters in body
Source Link
nulll
  • 1.5k
  • 1
  • 18
  • 30

In my opinion a very easy and clean way could be:

go back to A

git checkout A

create a new local branch from A

git checkout -bf tempA

point master's head to this new branchthe current state

git symbolic-ref HEAD refs/heads/master

save

git commit

cleanup (delete temp branch)

git branch -D temp

In my opinion a very easy and clean way could be:

go back to A

git checkout A

create a new local branch from A

git checkout -b temp

point master's head to this new branch

git symbolic-ref HEAD refs/heads/master

save

git commit

cleanup (delete temp branch)

git branch -D temp

In my opinion a very easy and clean way could be:

go back to A

git checkout -f A

point master's head to the current state

git symbolic-ref HEAD refs/heads/master

save

git commit
Source Link
nulll
  • 1.5k
  • 1
  • 18
  • 30

In my opinion a very easy and clean way could be:

go back to A

git checkout A

create a new local branch from A

git checkout -b temp

point master's head to this new branch

git symbolic-ref HEAD refs/heads/master

save

git commit

cleanup (delete temp branch)

git branch -D temp