0

I built a ruby on rails application, with my friend, but then had to delete my code because I made a giant mistake, I downloaded the code from my friend but the application did not work. Would I have redo all of my routes in terminal. If so, is it possible with all of my code being complete, and not doing it step by step?

neils
  • 655
  • 2
  • 6
  • 12
  • You'll have to redo everything you did that your friend didn't have in their code. You'll also have to learn about revision control so that this doesn't happen again. – mu is too short Aug 20 '13 at 06:06
  • If I pushed my code to GITHUB, but my last 2 pushes were bad, is there anyway that I could download an earlier version of my code? – neils Aug 20 '13 at 06:29
  • 1
    A bit of googling for "git rollback" might be useful, that will find you things like http://stackoverflow.com/q/373812/479863 – mu is too short Aug 20 '13 at 06:34

1 Answers1

0

You could either check your git log for the SHA you're interested in, and git checkout <SHA>, or you could do a git reset --soft HEAD^^ if you want to preserve those changes on staging (assuming you only need to go back two commits as the ^ correspond to how many commits you need to go back).

RubeOnRails
  • 1,153
  • 11
  • 22
  • Also, if you need to go back several commits, you could use `git reset --soft HEAD~40` to go back 40 commits. This just saves you from holding down the `^`. Cheers! – RubeOnRails Jan 03 '14 at 20:19