switch branch before copying files.