Undo last commit and unstage changes
Move HEAD back one commit. Changes stay in your files but are no longer staged
git reset HEAD~1
More git commands
-
git restore . && git clean -fdDiscard unstaged edits in tracked files and delete untracked files and directories
-
git tag -l -n1List all tags with the first line of each annotation
-
git tag -s v1.2.3 -m 'Release 1.2.3'Create an annotated tag signed with GPG for a release
-
git fetch --pruneRemove local refs to remote branches that no longer exist
-
git clone --depth=1 --single-branch --branch main <url>Clone only the latest commit of one branch. Good for fast CI checkouts