how to undo commit ahed in github code example Example: revert unpublished commits git reset --hard <hash-or-ref>