Ensure the repository does not differ from the provided revision

This PR ensures your repository is exactly on the provided revision, without any changes.

**Changes:**

- Report when the repository has changed by adding the suffix '-dirty' to the revision
- Remove the untracked files after a 'reset hard' (untracked but not ignored)
- Reset after checkout in every cases for consistency

I think most of people expect their repository to be exactly on the revision they provide.
But I also understand this is an important change in behavior.