Section C.6 Reverting To a Previous Commit
I have never had to do this (yet) so I don’t have direct experience here. However, user gunjanpatel on GitHub 68 has created a nice guide. It appears that
git reset HEAD^ --hard
and then git push origin -f
will work. The -f
switch forces the push and ignores errors.Some of the guide above refers to what is known as a commit hash, a unique string that identifies each commit on GitHub. These are actually so unique that we only need the first few characters of the string to identify the commit. You can find the hash by using Section B.2. The string is the random numbers/letters found on the right side of each commit.