def restore(source, offset):
    """
        Restore a smudged file from .bytes_backup
    """
    backup_location = os.path.join(
        os.path.dirname(os.path.abspath(source)), source + '.bytes_backup')
    click.echo('Reading backup from: {location}'.format(location=backup_location))

    if not os.path.isfile(backup_location):
        click.echo('No backup found for: {source}'.format(source=source))
        return

    with open(backup_location, 'r+b') as b:
        data = b.read()

    click.echo('Restoring {c} bytes from offset {o}'.format(c=len(data), o=offset))
    with open(source, 'r+b') as f:
        f.seek(offset)
        f.write(data)
        f.flush()

    click.echo('Changes written')
Restore a smudged file from .bytes_backup