Suggest an editImprove this articleRefine the answer for “What is HEAD in Git?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**HEAD** is a pointer to the current commit you are working with. **Key point:** HEAD is a pointer to the current commit or branch that defines the working state of the repository.Shown above the full answer for quick recall.Answer (EN)ImageHEAD is a **pointer to the current commit** you are working with. How HEAD works - usually `HEAD` points **to a branch** (for example, `main`); - the branch, in turn, points **to the last commit**; - new commits are added **wherever** `HEAD` **points**. ``` HEAD → main → C5 ``` ## Detached HEAD `HEAD` can point **to a specific commit**, rather than to a branch: - this state is called **detached HEAD**; - commits made in this state **do not belong to a branch**; - such commits can be lost when switching branches. ``` HEAD → C3 ``` ## Why HEAD is needed - it determines **which branch you are currently working on**; - it controls **where the next commit will be written**; - it allows moving through the project's history. ## Short answer for an interview > **HEAD is a pointer to the current commit or branch, defining the working state of the repository.**For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.