To accomplish this revision of history you copy ‘drunk’ to ‘working’ and delete the new file “bar.cpp”.
Now ‘working’ contains the first change only: the correct modifications to the existing function “foo”.