git checkout commit back to head code example Example: git go back to head after checkout commit git checkout branchname