Use git reflog
to see what your HEAD pointed to before you screwed it up.
You should see something like:
48ab8d HEAD@{0}: pull: Fast-forward
a34bda HEAD@{5}: commit: my last commit message
Now, point your master branch back at the commit before the bad pull:
git reset --hard a34bda
Done. Like it never happened.
Related Contents:
- How to list only the names of files that changed between two commits
- See what’s in a stash without applying it [duplicate]
- Pull latest changes for all git submodules
- Viewing unpushed Git commits
- Pull new updates from original GitHub repository into forked GitHub repository
- Pushing to Git returning Error Code 403 fatal: HTTP request failed
- Managing large binary files with Git
- How to determine when a Git branch was created?
- fatal: Not a git repository (or any of the parent directories): .git [duplicate]
- Start a Git commit message with a hashmark (#)
- Recursively add the entire folder to a repository
- Given a commit id, how to determine if current branch contains the commit?
- Change Git repository directory location.
- Exceptions in .gitignore [duplicate]
- How to remove a branch locally?
- How do I do an initial push to a remote repository with Git?
- Using .gitignore to ignore everything but specific directories
- Cannot push to Git repository on Bitbucket
- Is there a way to reduce the size of the git folder?
- Change the location of the ~ directory in a Windows install of Git Bash
- How can I push to my fork from a clone of the original repo?
- What’s the difference between “squash” and “fixup” in Git/Git Extension?
- What does the caret (^) character mean in Git?
- Issue pushing new code in Github
- Rebase a single Git commit
- Is there a way to squash a number of commits non-interactively?
- Switch Git branch without files checkout
- git: difference between “branchname” and “refs/heads/branchname”
- git rebase merge conflict
- Does Git publicly expose my e-mail address?
- How to perform better document version control on Excel files and SQL schema files
- How to colorize git-status output?
- git – gpg onto mac osx: error: gpg failed to sign the data
- Pull request without forking?
- How to rename a directory/folder on GitHub website?
- How to generate patch for all commits in a branch?
- Force Git submodules to always stay current
- Git: show total file size difference between two commits?
- Is there a Github clone in PHP that I can run on my own server? [closed]
- `git commit -v` by default
- Replace remote tag with Git
- Git not removing files when switching branch
- Git add a worktree from existing remote branch
- Undo a git merge (hasn’t been pushed yet)
- Is it possible to configure user.name and user.email per wildcard domains in .gitconfig?
- Git: created new branch from a wrong branch
- In Xcode 4 how do I add a remote GitHub repository to an existing local project?
- warning: refname ‘xxx’ is ambiguous when using git-svn
- Git squash all commits in branch without conflicting
- Command to open file with git