git checkout to undo a change

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #4759 Reply
    Humble
    Keymaster

    If the file is unstaged or commited, try:


    git checkout -- filename

    If its staged, but not committed, try:

    git reset HEAD filename
    git checkout -- filename

    If its committed, then try:

    git checkout origin/master filename

Viewing 1 post (of 1 total)
Reply To: git checkout to undo a change
Your information: