0

Until now I've did some basic operations with git, and in this real working scenario, I need to have access to an older version of a specified file. My question is how to transform a previous commit version in a new branch. Is it possible? How?

dole doug
  • 31,300
  • 20
  • 64
  • 85

2 Answers2

4

If you want to create a new branch at a arbitrary commit and check it out, do:

git checkout -b name_of_your_new_branch <sha1 of the commit>
knittl
  • 216,605
  • 51
  • 293
  • 340
1

If you just wan the older version of a file, you can do:

git checkout <commit> -- file
manojlds
  • 275,671
  • 58
  • 453
  • 409