Running git pull
performs the following tasks, in order:
git fetch
git merge
The merge step combines branches that have been setup to be merged in your config. You want to undo the merge step, but probably not the fetch (doesn’t make a lot of sense and shouldn’t be necessary).
To undo the merge, use git reset --hard
to reset the local repository to a previous state; use git-reflog to find the SHA-1 of the previous state and then reset to it.
Warning
The commands listed in this section remove all uncommitted changes, potentially leading to a loss of work:
git reset --hard
Alternatively, reset to a particular point in time, such as:
git reset --hard master@{"10 minutes ago"}
Related Posts:
- Undo git pull, how to bring repos to old state
- Git: How do I force “git pull” to overwrite local files?
- Differences between git pull origin master & git pull origin/master
- How do I rename a local Git branch?
- How do I discard unstaged changes in Git?
- Git: How to squash all commits on branch
- Git: cannot do a partial commit during a merge (SourceTree)
- Get changes from master into branch in Git
- Is it better to create a Git repository at the root level or in the WordPress theme directory?
- WordPress and Git: How does Git interact with your IDE? [closed]
- How do I delete a Git branch locally and remotely?
- How do I delete a Git branch locally and remotely?
- How do I rename a local Git branch?
- How do I undo the most recent local commits in Git?
- What is the best (and safest) way to merge a Git branch into master?
- Undo a Git merge that hasn’t been pushed yet
- How can I switch to another branch in git?
- Git merge hotfix branch into feature branch
- How do I discard unstaged changes in Git?
- Abort a Git Merge
- Git: How do I force “git pull” to overwrite local files?
- Download single files from GitHub
- How can I make git accept a self signed certificate?
- How to resolve merge conflicts in a Git repository
- How can I merge multiple commits onto another branch as a single squashed commit?
- How can I merge multiple commits onto another branch as a single squashed commit?
- Please enter a commit message to explain why this merge is necessary, especially if it merges an updated upstream into a topic branch
- The following untracked working tree files would be overwritten by merge, but I don’t care
- How can I revert multiple Git commits (already pushed) to a published repository?
- The following untracked working tree files would be overwritten by merge, but I don’t care
- What does “Git push non-fast-forward updates were rejected” mean?
- What is the difference between ‘git pull’ and ‘git fetch’?
- Git error on commit after merge – fatal: cannot do a partial commit during a merge
- Is there a “theirs” version of “git merge -s ours”?
- Git: How do I force “git pull” to overwrite local files?
- What is the meaning of git reset –hard origin/master?
- How can I reset or revert a file to a specific revision?
- Else clause on Python while statement
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- The following untracked working tree files would be overwritten by merge, but I don’t care
- .gitignore and “The following untracked working tree files would be overwritten by checkout”
- Is there a “theirs” version of “git merge -s ours”?
- Delete all local git branches
- Why does ‘git commit’ not save my changes?
- How can I undo git reset –hard HEAD~1?
- Set up git to pull and push all branches
- git push to specific branch
- Invalid VCS root mapping – 3 errors on my project
- Updates were rejected because the remote contains work that you do not have locally
- How to interactively (visually) resolve conflicts in SourceTree / git
- how to reset develop branch to master
- Do I commit the package-lock.json file created by npm 5?
- Is it possible to pull just one file in Git?
- How to resolve git status “Unmerged paths:”?
- How to keep a branch synchronized/updated with master?
- Resolve Git merge conflicts in favor of their changes during a pull
- Rebasing remote branches in Git
- Found a swap file by the name
- How can I see the changes in a Git commit?
- Is there a git-merge –dry-run option?
- Git pull – Please move or remove them before you can merge
- What is the Git equivalent for revision number?
- How can I delete all Git branches which have been merged?
- difference between git merge origin/master and git pull
- What’s a good (free) visual merge tool for Git? (on windows)
- Getting Started with Subversion, Git, or similar Version Control System to keep a History of my Files? [closed]
- Best way to version control WordPress template files?
- Should I use SVN or Git?
- WordPress Health Tool reporting version control as a critical issue
- storing database in version control
- Versioning and your WordPress site?
- Pull latest stable release via git [closed]
- How to make changes on WordPress site locally on live site?
- How should I be handling my theme version numbering?
- Version control with a team of non-developers
- Painless way to track remote Git repo for WordPress updates
- Questions about Git and WordPress [duplicate]
- How to change version numbers in themes from Official repository?
- Checking for a new version from WP Repos
- How to rename the wp-config.php file once under version control?
- When developing entire sites for clients, is it viable to version control the entire site? [duplicate]
- WordPress project under Mercurial, what’s an appropriate .hgignore file?
- How to use one git (github) repository for version control for multiple themes
- version control for wordpress? (wordpress folder and database at same time)
- Revision History for Entire WordPress Site
- If you already have a copy of the code, is there any reason to create a feature branch?
- How do I use ‘git reset –hard HEAD’ to revert to a previous commit? [duplicate]
- Difference between Git and GitHub
- Could not open a connection to your authentication agent
- Trying to git pull with error: cannot open .git/FETCH_HEAD: Permission denied
- What’s the difference between git switch and git checkout
- Bower: ENOGIT Git is not installed or not in the PATH
- git add only modified changes and ignore untracked files
- How can I generate a Git patch for a specific commit?
- git fetch doesn’t update my local repository
- Keeping WP database synced across multiple developers using git
- GIT and Development URL’s point to production
- WordPress 3.8 keeps asking me to upgrade to 3.8
- Best workflow for Git theme development with plugins [closed]
- How to update WordPress plugins properly using git?