[git newbie here]
I have the following commits:
[c1]-->[c2]-->[c3]-->[c4]-->[c5]
HEAD is now at c5
but I realized that c4
and c5
are not good and I wish to continue from c3
. In other words, I wish to revert to c3
mark it as HEAD and continue from this point on (make changes form this point). How can I do that?
when I get the commit of c3
$git checkout c3
improve some files and:
git add .
git commit -m 'lets continue from c3'
git push
it says:
fatal: You are not currently on a branch.
To push the history leading to the current (detached HEAD)
state now, use
git push origin HEAD:<name-of-remote-branch>