thinQmaster Virtual testing partner Adaptive practice exams that find your weak spots and drill them. Every answer explained. From $69
Enroll

thinQmaster

Find your exam

Five questions free, before you decide.

Step 1 · choose a vendor

In one of our camps? Your practice exams come with the tuition — they are on your study page already.

DevOps & Automation · Intermediate

HEAD

A Git reference to the currently checked-out commit, usually pointing indirectly to the current branch.

Definition

HEAD moves when you commit or switch branches. HEAD~1 refers to the parent commit. A detached HEAD occurs when you check out a specific commit or tag rather than a branch.

Example

git reset --soft HEAD~1 undoes the last commit but keeps changes staged.

Exam tip

In detached HEAD state, new commits are lost unless you create a branch for them.

Related terms