Re: Undo a commit that is already pushed to central server and merged to several branches
- From
Ramkumar Ramachandra <artagnon@gmail.com>
- Date
- Dec 7, 2011, 16:01 UTC
- Message-ID
- <CALkWK0msjfebnE=q_ykx3+iVkeT2aa1A2BmtrHCw2wGaZzOC8w@mail.gmail.com>
- In-Reply-To
- <4EDF87A6.4000703@fechner.net>
Hi Matthias,
Matthias Fechner wrote:
Show 14 quoted lines
> Am 07.12.11 15:42, schrieb Ramkumar Ramachandra: > >> Assuming that you actually want to rewrite the history, the situation >> calls for a git-reset(1). Just "git reset --hard HEAD~1" on each of >> your branches (Caution: first understand what it does!) and you'll > > > that will not work, because in the master branch I already have around 15 > commits after the bogus commit and I want to keep these commits. > > And in some other branches there are tons of commits (over 100) after the > bogus commit with the merge and I only want to remove that bogus commit but > keep all other commits after the bogus commit (all commits are not related > to the bogus one, they are all in different files).
I see. I won't attempt to repeat what Junio and Linus have explained in this document then [1].
Cheers.
[1]: http://schacon.github.com/git/howto/revert-a-faulty-merge.txt
-- Ram