Hi Mikko,

I just(*) want to caution against the "just git reset --hard <sha1 you want>" that tends to creep in to a lot of Git discussions. For the most part, one (i.e. wider readership) should also think 'how/why did I get into this situation?', and is there a better way out using 'proper' Git commands to get out of my situation. I'd agree that the git commands can be in unexpected places, and an alias can become helpful, but folks, be careful out there of resetting too hard ;-)

git reset --hard <options> is right in some cases but has become overloaded.

Philip

(*) You may notice I also said 'just' which means I also fall into the trap as well.

On 07/04/2019 19:31, Mikko Rantalainen wrote:
On Sun, 7 Apr 2019, 20:46 , <neverasi...@gmail.com <mailto:neverasi...@gmail.com>> wrote:

      *  ... however how to undo a rebasing (if possible) will be a
        future deepening of mine,

Rebase always creates technically new commits instead of replacing old commits. You can simply hard reset your branch wherever you want. Command "git reflog --help" will provide more information. And once you know the sha1, you can just git reset --hard <sha1 you want> and git will overwrite all files and index with the old committed state. There's nothing else to undo.

--
Mikko

--
You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com <mailto:git-users+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Git for 
human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to