Flags largely began to disappear soon after the American civil war, regiments in many countries still issued them, but when warfare became less linear then the main purpose of a flag (identification and a point to rally around) became obsolete. By the First World War flags were largely discarded.
During the First World War for example, the Czechoslovak legion of France had a flag and it seems that they carried it into battle.