Not particularly easily- if you’ve lost the pointer to the tip of a branch, it’s rather like finding a needle in a haystack. You can find all the commits that don’t appear to be referenced any more- git fsck --unreachable
will do this for you- but that will include commits that you threw away after a git commit --amend
, old commits on branches that you rebased etc etc. So seeing all these commits at once is quite likely far too much information to wade through.
So the flippant answer is, don’t lose track of things you’re interested in. More seriously, the reflogs will hold references to all the commits you’ve used for the last 60 days or so by default. More importantly, they will give some context about what those commits are.
Related Posts:
- Pretty Git branch graphs
- Commit history on remote repository
- How do I run git log to see changes only for a specific branch?
- How to use Git Revert
- How do I properly force a Git push?
- How to remove local (untracked) files from the current Git working tree
- How to modify existing, unpushed commit messages?
- Git pushing to remote branch
- How to revert a merge commit that’s already pushed to remote branch?
- GitHub Error Message – Permission denied (publickey)
- How to uncommit my last commit in Git [duplicate]
- Handling file renames in Git
- Delete commits from a branch in Git
- Why are there two ways to unstage a file in Git?
- Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools)
- Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists
- How do I push a new local branch to a remote Git repository and track it too?
- How do you push a tag to a remote repository using Git?
- ‘git’ is not recognized as an internal or external command
- Gitignore not working
- How do I resolve git saying “Commit your changes or stash them before you can merge”?
- How do I rename both a Git local and remote branch name?
- Configuring so that pip install can work from github
- How to cherry-pick multiple commits
- Undo git pull, how to bring repos to old state
- Another git process seems to be running in this repository
- rejected master -> master (non-fast-forward)
- Heroku: “No default language could be detected for this app” error thrown for node app
- merge one local branch into another local branch
- Move the most recent commit(s) to a new branch with Git
- How can I determine the URL that a local Git repository was originally cloned from?
- 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?
- Meaning of the GitHub message: push declined due to email privacy restrictions
- Download a specific tag with Git
- Is there a command to undo git init?
- How to undo ‘git reset’?
- Download a single folder or directory from a GitHub repo
- fatal: Not a valid object name: ‘master’
- Git and nasty “error: cannot lock existing info/refs fatal”
- Is there a “git touch” so I can push the same file with a new timestamp?
- Branch from a previous commit using Git
- Git Bash won’t run my python files?
- Hard reset of a single file
- Not a valid object name: ‘master’
- Delete all local git branches
- git add remote branch
- Git error on git pull (unable to update local ref)
- git status shows modifications, git checkout —
doesn’t remove them - ‘cannot open git-upload-pack’ error in Eclipse when cloning or pushing git repository
- How do I copy a version of a single file from one Git branch to another?
- Undo a git stash
- Undo git stash pop that results in merge conflict
- How can I undo git reset –hard HEAD~1?
- How to clone all remote branches in Git
- Set up git to pull and push all branches
- Git Push ERROR: Repository not found
- “Unable to find remote helper for ‘https'” during git clone
- Why does Git tell me “No such remote ‘origin'” when I try to push to origin?
- Unity Collaborate vs GitHub
- What is the difference between pull and clone in git?
- How do I clone a single branch in Git?
- how to reset develop branch to master
- npm ERR! No git binary found in $PATH
- SourceTree keeps asking for Github password
- How to change the license for a project at Github?
- Git add all files modified, deleted, and untracked?
- How to switch back to ‘master’ with git?
- fatal: could not read Username for ‘https://github.com’: No such file or directory
- Github Authentication Failed – … GitHub does not provide shell access
- How do I pull files from remote without overwriting local files?
- Git push existing repo to a new and different remote repo server?
- How to keep a branch synchronized/updated with master?
- What is the Git equivalent for revision number?
- TortoiseGit-git did not exit cleanly (exit code 1)
- Your repository has no remotes configured to push to
- Specify an SSH key for git push for a given domain
- How do I “un-revert” a reverted Git commit?
- git push not send changes to remote git repository
- How to merge a specific commit in Git
- How do I clone a subdirectory only of a Git repository?
- Pod install is staying on “Setting up CocoaPods Master repo”
- How to use Git and Dropbox together?
- Git: Where exactly is the “working directory”?
- What exactly does the “u” do? “git push -u origin master” vs “git push origin master”
- Should I use SVN or Git?
- git and local wordpress: how to handle wordpress updates?
- WordPress Health Tool reporting version control as a critical issue
- Deploying Updated or New Plugins That Modify the wp_options Table
- Deploy pre-configured database
- Collaboratively develop a WordPress site
- Add latest commit info on login footer using login_footer hook
- SymmetricDS in dev + prod workflow?
- Plugin updated pushed with git break site
- Display GitLab repositories of the logged in user on a page
- Git ignore everything except custom theme directory
- version control for wordpress? (wordpress folder and database at same time)
- How to make a copy of a local wordpress build in MAMP?