1

I am working on a project and we have a file where a few blocks of code that go together were deleted at different intervals a few commits back. I need to recover only some of these blocks and put them into something else I'm making. Is there a way to see the old blocks that were committed and copy them without having all the junk before/around the lines (like when you look at it with Git Extensions or GitHub. I basically just want to be able to grab some old code blocks manually for use in another project that isn't on the repository.

Thanks

TheFrack
  • 2,823
  • 7
  • 28
  • 47

2 Answers2

1

In github you can view the list of commits, simply click "view code" next to the commit where this code still exists. Then you can browse to the files that contains the code you want and click "raw" to see the file without "having all the junk".

Tomdarkness
  • 3,800
  • 2
  • 21
  • 26
1

The general idea would be to:

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