<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def undo(scm, verbose, fake, hard):
 """Removes the last commit from history."""

    scm.fake = fake
    scm.verbose = fake or verbose

    scm.repo_check()

    status_log(scm.undo, 'Last commit removed from history.', hard)