def undo_last_csv_import(request):
    revision = Revision.objects.filter(user=request.user).order_by(
        '-date_created')[0]
revision.revert(delete=True)
How to implement an "undo" feature using Python/Django