skip to main | skip to sidebar

{object: literal}

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." 
Posted by JasonOng at 4:36 PM

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Blog Archive

  • ►  2014 (5)
    • ►  May (1)
    • ►  March (2)
    • ►  February (2)
  • ▼  2013 (6)
    • ▼  November (3)
      • Send/write code in Gmail emails
      • Checkout version of a file in previous git commit
      • Get large facebook profile picture from facebook id.
    • ►  February (2)
    • ►  January (1)
  • ►  2012 (42)
    • ►  December (2)
    • ►  November (1)
    • ►  October (9)
    • ►  September (1)
    • ►  August (9)
    • ►  July (3)
    • ►  June (7)
    • ►  May (4)
    • ►  March (1)
    • ►  February (4)
    • ►  January (1)
  • ►  2011 (29)
    • ►  December (1)
    • ►  October (2)
    • ►  September (2)
    • ►  July (1)
    • ►  June (2)
    • ►  May (3)
    • ►  April (2)
    • ►  March (2)
    • ►  February (3)
    • ►  January (11)
  • ►  2010 (102)
    • ►  December (21)
    • ►  November (5)
    • ►  October (3)
    • ►  September (4)
    • ►  August (3)
    • ►  July (5)
    • ►  June (5)
    • ►  May (10)
    • ►  April (5)
    • ►  March (17)
    • ►  February (12)
    • ►  January (12)
  • ►  2009 (143)
    • ►  December (1)
    • ►  November (10)
    • ►  October (26)
    • ►  September (68)
    • ►  August (20)
    • ►  July (15)
    • ►  April (3)
  • ►  2008 (2)
    • ►  March (2)