git reflog
is your friend. Find the commit that you want to be on in that list and you can reset to it (for example:git reset --hard e870e41
).
(If you didn’t commit your changes… you might be in trouble – commit early, and commit often!)
More Related Contents:
- Definition of “downstream” and “upstream”
- How do I view ‘git diff’ output with my preferred diff tool/ viewer?
- Git – how to force merge conflict and manual merge on selected file
- SSL certificate rejected trying to access GitHub over HTTPS behind firewall
- error: RPC failed; curl transfer closed with outstanding read data remaining
- GitHub – failed to connect to github 443 windows/ Failed to connect to gitHub – No Error
- Git: Correct way to change Active Branch in a bare repository?
- Is it possible to push a git stash to a remote repository?
- How do I use ‘git reset –hard HEAD’ to revert to a previous commit? [duplicate]
- How to git rebase a branch with the onto command?
- Are Git’s pack files deltas rather than snapshots?
- Use git “log” from another folder
- git still shows files as modified after adding to .gitignore
- How to clone a specific Git tag
- Git: Ignoring Version-Controlled Files
- What’s the easiest way to deploy a folder to a branch in git?
- github: No supported authentication methods available
- Trouble setting up git with my GitHub Account error: could not lock config file
- How do I add files and folders into GitHub repos?
- How do I squash two non-consecutive commits?
- How do I select a merge strategy for a git rebase?
- What does tree-ish mean in Git?
- Why is git is ignoring files that aren’t in the .gitignore file?
- What are the consequences of using receive.denyCurrentBranch in Git?
- Git: add vs push vs commit
- Unignore subdirectories of ignored directories in Git
- How to check if remote branch exists on a given remote repository?
- How to push new branch without history
- Why does ‘git commit’ not save my changes?
- Viewing full version tree in git