Friday, November 15, 2013

Checkout version of a file in previous git commit


# This rolls back the diff of the file in the git commit
git checkout COMMIT_SHA FILE

# Commit the file modification (rolled back diff)
git add FILE
git commit -m "Check out previous version of file." 

No comments: