Instructor: In our local repository here, we have different kind of commits. You can see here, this is the point which has already been synchronized with a remote repository. We have two further commits added on top of them.
Let's assume that we committed them, but we changed our mind and we actually want to completely discard them. What we can do is we can copy here the ID of that commit to which we want to return.
The important part here is don't return before the things that have been synchronized with the remote repository.
We can use the git reset command --hard, and then basically use that commit ID. What will happen, if we execute that, and then do a git log again, is that we will now see that the first two commits have been discarded and we have jumped back to the point to which we have synchronized with the remote repository.
Note that the --hard command here also changes your local working directory to make it point to exact the same commit. If you had unsynchronized changes or uncommitted changes still pending in your local workspace, those would be discarded.
To avoid that, simply remove that --hard.