0

So for example i have this history:

commit 1a7cab6c279f5528871cd0ab8dae55319ff81fc0
Author: unknown <poru@.(none)>
Date:   Thu Mar 10 20:11:39 2011 +0800

    Changes to login style, will based the admin on this. version-1

commit 22d308ba085a5d04eadf54fd06f3534e876386de
Author: David Ang <davidang09@gmail.comm>
Date:   Tue Mar 8 23:40:59 2011 +0800

    fixed config settings to run in production mode and removed special
    characters thats disrupting heroku

commit 410b383e105fac39bd70095b186367fa943b1ad8
Author: David Ang <davidang09@gmail.comm>
Date:   Fri Mar 4 01:29:45 2011 +0800

     show pretty time ago
     provide icons
     hide mass delete
     removed special character

commit 789922463ad946c945893c9a8787e589f780fda1
Author: unknown <poru@.(none)>
Date:   Thu Mar 3 18:34:09 2011 +0800

     Tempory style for Login. Will replace this once done with the admin
     styles.

We have a new design going on the most recent commit - but i wanted now to switch back to our original design which is commit 78992246.

I was like doing something like this earlier:

git checkout 78992246

Then I was hoping to just merge these back to the head of master.

Unfortunately im not getting anywhere

Mark Longair
  • 446,582
  • 72
  • 411
  • 327
David
  • 4,235
  • 12
  • 44
  • 52

2 Answers2

2

Here are some steps to do it.

# Create a branch pointing to the original design and checkout to that branch.
git checkout -b original_design 78992246

# Work on it and commit your works on this branch.
git commit ...

# Once you're done, checkout your master branch.
git checkout master

# If you want to, pull from origin to update your master branch.
git pull

# Merge your original_design branch back to master.
git merge original_design
htanata
  • 36,666
  • 8
  • 50
  • 57
  • I have been already doing this. That's my problem, step #2. I don't want to do any changes i just want to checkout the old design, then merge it to the head of the master branch. Doing it this way git just tells me "Already uptodate". – David Mar 12 '11 at 10:49
  • by the way when i say i could not edit these files - im also referring to binary files - eg, images etc., So I just want to put those images from my old design to the head of the master. – David Mar 12 '11 at 12:11
  • 1
    @David What are you trying to do exactly? Are you trying to revert everything to 78992246 or just some of the files? – htanata Mar 13 '11 at 01:49
1

Once you have switched to the right commit, you should create a branch before attempting any merge.

git checkout -b newdesign 

or in one step

git checkout -b newdesign 78992246

Other wise you would be in a detached head mode.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250