[Development] Recover from a bad rebase (incorrect squash)

2013-10-21 Thread Mandeep Sandhu
Hi All,

Is there a safe to recover from a bad rebase ? I've squashed commits
incorrectly.

Situation before rebase was:

(oldest) A - B - C - D (newest)

I wanted to squash B  D together so during interactive rebase, I
chose 'squash' options for B  D (wrongly assuming that these 2 would
get squashed) which squashed B with A, D with C.

What I should've done probably is to rearrange the commits as A - B
- D - C and then put 'squash' for D which would've merged B  D
together.

Anyhow, is there a way to recover cleanly from this mess? I want to
get the ld commit hostory (before this rebase) back.

Thanks for any tips.

-mandeep
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Recover from a bad rebase (incorrect squash)

2013-10-21 Thread Koehne Kai

 -Original Message-
 From: development-bounces+kai.koehne=digia@qt-project.org
 [mailto:development-bounces+kai.koehne=digia@qt-project.org] On
 Behalf Of Mandeep Sandhu
 Sent: Monday, October 21, 2013 1:50 PM
 To: development@qt-project.org
 Subject: [Development] Recover from a bad rebase (incorrect squash)
 
 Hi All,
 
 Is there a safe to recover from a bad rebase ? I've squashed commits
 incorrectly.

Use 'git reflog' to get the HEAD of the commit before the squash, and use git 
reset to restore it.

Regards

Kai
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Recover from a bad rebase (incorrect squash)

2013-10-21 Thread Mandeep Sandhu
 Hi All,

 Is there a safe to recover from a bad rebase ? I've squashed commits
 incorrectly.

 Use 'git reflog' to get the HEAD of the commit before the squash, and use git 
 reset to restore it.

Thanks Kai! That fixed it!

-mandeep


 Regards

 Kai
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development


Re: [Development] Recover from a bad rebase (incorrect squash)

2013-10-21 Thread Konstantin Tokarev


21.10.2013, 16:06, Mandeep Sandhu mandeepsandhu@gmail.com:
  Hi All,

  Is there a safe to recover from a bad rebase ? I've squashed commits
  incorrectly.
  Use 'git reflog' to get the HEAD of the commit before the squash, and use 
 git reset to restore it.

 Thanks Kai! That fixed it!

Note that it's very hard to lose committed data in git - reflog will recover 
you from wrong
git commit --amend, git reset --hard, git branch -D, etc. Old copies of each 
object you modify
are kept at least for 2 weeks in default configuration.

Uncommitted changes in working copy are much more vulnerable.

-- 
Regards,
Konstantin
___
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development