All of lore.kernel.org
 help / color / mirror / Atom feed
* Reverting a specific commit
@ 2010-09-23  7:13 milindkanchan
  2010-09-23  7:17 ` John Tapsell
  2010-09-23  7:17 ` Pascal Obry
  0 siblings, 2 replies; 5+ messages in thread
From: milindkanchan @ 2010-09-23  7:13 UTC (permalink / raw)
  To: git


Hi All,

I am using git for code management.

I have some query regarding reverting the commit in git.

Can we revert a specific commit in git ?

Eg. One of our X developer has committed the code in master branch last
week, after which there were several commits to master branch, now there was
an issue with the code committed by X developer and now I need to
revert/discard just his commit keeping the other commits done after him as
intact.

Can anybody give a solution for this with all the commands.

Thanks & Regard
M.K

-- 
View this message in context: http://git.661346.n2.nabble.com/Reverting-a-specific-commit-tp5561992p5561992.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reverting a specific commit
  2010-09-23  7:13 Reverting a specific commit milindkanchan
@ 2010-09-23  7:17 ` John Tapsell
  2010-09-23  7:17 ` Pascal Obry
  1 sibling, 0 replies; 5+ messages in thread
From: John Tapsell @ 2010-09-23  7:17 UTC (permalink / raw)
  To: milindkanchan; +Cc: git

On 23 September 2010 08:13, milindkanchan <milindkanchan@gmail.com> wrote:
>
> Hi All,
>
> I am using git for code management.
>
> I have some query regarding reverting the commit in git.
>
> Can we revert a specific commit in git ?

To make a new commit to undo a bad commit:

git revert SHA

where SHA is that long string of numbers and letters associated with
each commit.  do "git log" to find out what the SHA is.

John

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reverting a specific commit
  2010-09-23  7:13 Reverting a specific commit milindkanchan
  2010-09-23  7:17 ` John Tapsell
@ 2010-09-23  7:17 ` Pascal Obry
  2010-09-23  8:01   ` milindkanchan
  1 sibling, 1 reply; 5+ messages in thread
From: Pascal Obry @ 2010-09-23  7:17 UTC (permalink / raw)
  To: milindkanchan; +Cc: git

On Thu, Sep 23, 2010 at 9:13 AM, milindkanchan <milindkanchan@gmail.com> wrote:
> Can we revert a specific commit in git ?

   $ git revert <sha1>

for more information:

   $ git revert --help

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reverting a specific commit
  2010-09-23  7:17 ` Pascal Obry
@ 2010-09-23  8:01   ` milindkanchan
  2010-09-23  9:05     ` Pascal Obry
  0 siblings, 1 reply; 5+ messages in thread
From: milindkanchan @ 2010-09-23  8:01 UTC (permalink / raw)
  To: git


But will it affect the commits done after that
-- 
View this message in context: http://git.661346.n2.nabble.com/Reverting-a-specific-commit-tp5561992p5562096.html
Sent from the git mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Reverting a specific commit
  2010-09-23  8:01   ` milindkanchan
@ 2010-09-23  9:05     ` Pascal Obry
  0 siblings, 0 replies; 5+ messages in thread
From: Pascal Obry @ 2010-09-23  9:05 UTC (permalink / raw)
  To: milindkanchan; +Cc: git

On Thu, Sep 23, 2010 at 10:01 AM, milindkanchan <milindkanchan@gmail.com> wrote:
>
> But will it affect the commits done after that

No. It is a revert. I will create a new commit that revert the work
done for the given commit.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|              http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-09-23  9:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-23  7:13 Reverting a specific commit milindkanchan
2010-09-23  7:17 ` John Tapsell
2010-09-23  7:17 ` Pascal Obry
2010-09-23  8:01   ` milindkanchan
2010-09-23  9:05     ` Pascal Obry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.