Kevin Wilson <> writes:
> Is there a command to roll back to the first commit in a repository?

Assuming that you want to reset the HEAD branch and the working
directory to be in the state of the first commit, the command would be:

    git reset --hard {first-commit-hash}

As far as I know, there is no syntax to identify the oldest commit on
the current branch.  But 

    git log --pretty=tformat:"%h %ai %s"

will list all the commits that are part of the current branch, and from
those you can select the hash of the oldest one.


You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
For more options, visit

Reply via email to