B -> C -> D -> E I tried rolling ba...">

How to solve the "error: it is impossible to click on an unqualified address: HEAD"

I have a revision like A -> B -> C -> D -> E I tried rolling back to C and committed this as a new revision of F , but it doesn't seem to be the right way: I git checkout C , and then do some changes and then git commit . However, when I git push origin HEAD , it complains that:

error: unable to push to unqualified destination: HEAD The destination refspec neither matches an existing ref on the remote nor begins with refs/, and we are unable to guess a prefix based on the source ref.

As this SO question suggests, I tried git fetch -p origin , but that didn't work. The same error message is still received.

My question is, how can I get rid of this situation and fulfill my original goal (rollback to C and pass this to F )?

In addition, as follows from this question, I can:

 git rm -r . git checkout HEAD~3 . git commit 

but i really don't want git rm -r . , because there are many unsolicited, but useful things.

+4
source share
1 answer

It looks like you are looking for git revert . In your case:

 git revert ED 

After that, you can reinstall to squeeze the two reversing fixations together.

+2
source

Source: https://habr.com/ru/post/1496929/


All Articles