def METHOD_NAME(testrepo, new_content):
    # Create the patch
    with (Path(testrepo.workdir) / 'hello.txt').open('wb') as f:
        f.write(new_content.encode('utf-8'))
    patch = testrepo.diff().patch
    # Rollback all changes
    testrepo.checkout('HEAD', strategy=pygit2.GIT_CHECKOUT_FORCE)
    # Return the diff
    return pygit2.Diff.parse_diff(patch)