mrtnzlml
mrtnzlml

Reputation: 101

Unsuccessful git push – cannot push again

I want to push commits into two repositories like this:

[remote "origin"]
    url = https://[email protected]/mrtnzlml/www.zeminem.cz.git
    url = https://github.com/mrtnzlml/www.zeminem.cz.git
    fetch = +refs/heads/*:refs/remotes/origin/*

Works (almost) perfectly until today. Last push (via PhpStorm IDE) caused this error:

Push failed
error: Connection time-out while accessing https://[email protected]/mrtnzlml/www.zeminem.cz.git/info/refs?service=git-receive-pack
fatal: HTTP request failed

Unfortunately there are not these commits on the remote servers and I cannot see them on localhost anymore (using git status). But I found get reflog commmand:

91a20c9 HEAD@{0}: checkout: moving from pictures to develop
7829ccc HEAD@{1}: commit: WP like pictures draft
e59196f HEAD@{2}: checkout: moving from develop to pictures

How can I jump back to the 7829ccc commit (without data lost) and try to repush it? I found some ridiculous solutions eg. make new git clone and copy changes from old project but I don't want to do that...

Upvotes: 2

Views: 223

Answers (1)

mrtnzlml
mrtnzlml

Reputation: 101

Yaay! (-: I finally solved this issue thank to this question.

So the solution is actually simple:

git push origin 7829ccc:pictures

Upvotes: 1

Related Questions