Reputation: 4857
My question is perhaps very basic, but how do I edit a specific file from a version commit (whose author is a colleague working on the same remote repo as me) from which I know the SHA ?
Upvotes: 2
Views: 100
Reputation: 26755
git checkout hashOfCommit path/to/file
You can then edit the file and commit your changes to the branch you are on currently.
Upvotes: 2
Reputation: 382130
If what you want is to get the content of the file, you can do
git show someHash:pathToFile
If you want to see the differences between current version of the file with the one of the commit, you may do
git diff someHash pathToFile
If you want to replace current version of the file with the one of the commit, you may do
git reset --hard someHash pathToFile
Upvotes: 3