It means not to worry about things that have already happened.
Just like the milk can't be put back into the glass, you can't change what has already happened.
This is a pretty common phrase and a nice one to use when someone if upset about something in the past.