Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 4
    Please explain the difference between git reset <file> and git checkout <file>.
    – Trent
    Commented Jan 22, 2018 at 23:47
  • 1
    reset doesn't change the file, just put it away from the stage (=index, where it was put by git add)
    – franc
    Commented Mar 12, 2018 at 11:18
  • checkout change the codes in file and move to the last updated state. reset doesn't change the codes it just reset the header. As example, reset use for added or committed files resetting before push and checkout use for back to the last updated/committed stage before git add. Commented Mar 14, 2018 at 11:38
  • 1
    reset = remove the file from stage however changes will still be there. checkout = gets the updated file from the repository and will overrides the current file
    – Imam Bux
    Commented Sep 12, 2018 at 10:16