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