The location can be a hash associated with a commit or something like HEAD~1 which takes you to HEAD, then back down the tree 1 time. It's important to not use git reset after pushing a commit because it'll change the history other people may have already downloaded. The common flags you will see are --soft, --hard, and --mixed.
Table of contents
Change a Commit Message that Hasn't Been Pushed YetAdd More Files and Changes to a Commit Before PushingRemove Files from Staging Before CommittingUse and Compare the Different git Reset Options: --hard, --soft, and --mixedRecover Local Changes from git reset --hard with git reflogUndo a Commit that has Already Been PushedPush a New Branch to github that Doesn't Exist Remotely YetCopy a Commit from One Branch to AnotherMove a Commit that was Committed on the Wrong BranchUse git stash to Save Local Changes While PullingExplore Old Commits with a Detached HEAD, and then RecoverFix a Pull Request that has a Merge ConflictCleanup and Delete Branches After a Pull RequestChange the Commit Message of a Previous Commit with Interactive Rebasegit Ignore a File that has Already been Committed and PushedAdd a File to a Previous Commit with Interactive RebaseFix Merge Conflicts While Changing Commits During an Interactive RebaseSquash Commits Before they are Pushed with Interactive RebaseCompletely Remove a File from Pushed git HistoryResources2 Comments
Sort: