git, how to I go back to origin master after pulling a branch

This has to be a FAQ, but I can’t find it googling.

Another person created a branch, commit’d to it, and pushed it to github using
git push origin newbranch

  • Are submodules for plugins or for dependencies?
  • gitignore all files of extension in directory
  • How do I use octal characters in a git checkout?
  • git fails because of an untracked working tree file
  • How to weed out case-sensitivity issues in git on OS X?
  • What is a git boundary commit
  • I successfully pulled it down using

    git pull origin newbranch

    Now, I want to go back to the origin master version.
    Nothing I do seems to cause the files in the origin master to replace those in the newbranch.

    git checkout master
    git checkout origin master
    git pull
    git pull origin HEAD

    git pull origin master returns:

    * branch            master     -> FETCH_HEAD
    Already up-to-date.

    This can’t be hard, but I sure can’t figure it out.

    ‘git branch’ returns

    * master

    and ‘git branch -r’ return


  • git says project description file hasn't been modified even when it is actually modified
  • Only push certain files once
  • Delete local Git branches after deleting them on the remote repo
  • cloning error when checking out private github repo
  • What is the difference between git pull and git reset --hard origin/<branch>?
  • git-crypt cleartext protection?
  • 2 Solutions collect form web for “git, how to I go back to origin master after pulling a branch”

    This should work to do what you need:

    git checkout origin/master

    Next time, maybe you can use git fetch first, after that, use git merge.

    This will make your operation more clear.


    Git Baby is a git and github fan, let's start git clone.