Make auto staging releasing and undo support for MAC

Change-Id: I8b4d82b2b7cdfd8b21815b48defeb5b3f9cb5598