[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Branch "next" garbled
From: |
Uwe Koloska |
Subject: |
Re: [O] Branch "next" garbled |
Date: |
Wed, 3 Oct 2018 22:46:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 |
Am 03.10.18 um 13:45 schrieb Marco Wahl:
> My git fu was not strong enough and so the "next" branch is a bit messy
> right now. (I tried to activate a local clean version of the "next"
> branch.)
>
> I thought I could easily rollback the mess I created by going back to
> the git node 3c8fd4fa7 which is the last git node before my activities.
>
> The command I used is
>
> git revert 3c8fd4fa7
>
> Unfortunately this did not revert the repo to that node.
To make your git fu a bit stronger, let me explain this:
'git revert' creates a new commit, that reverses the changes from the
given commit, so it's not, what you have had in mind (and what is common
for SCMs like SVN where you cannot rewrite the history). You are looking
for 'git reset':
https://git-scm.com/book/en/v2/Git-Tools-Reset-Demystified
There are other ways, to achieve the same result:
Just rename the branch and checkout a new one with the old name at the
given commit. That gives you a nice backup for free.
Or utilize the 'reflog':
http://gitready.com/intermediate/2009/02/09/reflog-your-safety-net.html
Hope this helps
Uwe