git - How to solve "error: unable to push to unqualified destination: HEAD" -


i have revision a -> b -> c -> d -> e. tried rollback c , commit new revision f seems it's not right way it: git checkout c , changes , git commit. however, when git push origin head complains that:

error: unable push unqualified destination: head destination refspec neither matches existing ref on remote nor begins refs/, , unable guess prefix based on source ref.

as this question suggests, tried git fetch -p origin didn't work. still got same error message.

my question how can rid of situation , fulfill original goal (rollback c , commit f)?

also, question suggests, can:

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

but don't want git rm -r . because there lot of untracked useful stuff.

it sounds you're looking git revert. in case:

git revert e d 

afterwards can rebase squash 2 reverting commits together.


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -