Repository: vscode
Issue: Git - File changed while open in vscode: Marks are left in editor
Labels: bug,git

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->

I noticed that when a file switches underneath VSCode, for example when you do git operations, the same file can be newer on disk than in the editor. Under these circumstances VSCode forces you to accept either the version in the editor or on disk. If you choose the version on disk, the marks that are temporarily placed there by VSCode in the moment of comparison later remain in the file. The file is left with lots of "<<<<<<< HEAD" or "=======" as you can see below. I suppose that is not the intended behaviour?

- VS Code Version: 1.64.2
- OS Version: Windows 10

Steps to Reproduce:

1. Rebase a project/file while editor is open for that file
2. Revert to old file content (discard your changes)


**Example with settings.json**
```
{
<<<<<<< HEAD
    "cmake.configureOnOpen": false,
    "C_Cpp.errorSquiggles": "Disabled",
<<<<<<< HEAD
<<<<<<< HEAD
    "idf.adapterTargetName": "esp32"
=======
>>>>>>> c0f9272 (updating)
=======
    "idf.adapterTargetName": "esp32",
<<<<<<< HEAD
>>>>>>> 23114eb (updating)
=======
    "idf.openOcdConfigs": [
        "interface/ftdi/esp32_devkitj_v1.cfg",
        "target/esp32.cfg"
    ],
    "idf.pythonBinPathWin": "C:\\dev\\esp\\.espressif\\python_env\\idf4.4_py3.8_env\\Scripts\\python.exe",
    "idf.toolsPathWin": "C:\\dev\\esp\\.espressif",
    "idf.customExtraPaths": "C:\\dev\\esp\\.espressif\\tools\\xtensa-esp32-elf\\esp-2021r1-8.4.0\\xtensa-esp32-elf\\bin;C:\\dev\\esp\\.espressif\\tools\\xtensa-esp32s2-elf\\esp-2021r1-8.4.0\\xtensa-esp32s2-elf\\bin;C:\\dev\\esp\\.espressif\\tools\\xtensa-esp32s3-elf\\esp-2021r1-8.4.0\\xtensa-esp32s3-elf\\bin;C:\\dev\\esp\\.espressif\\tools\\riscv32-esp-elf\\esp-2021r1-8.4.0\\riscv32-esp-elf\\bin;C:\\dev\\esp\\.espressif\\tools\\esp32ulp-elf\\2.28.51-esp-20191205\\esp32ulp-elf-binutils\\bin;C:\\dev\\esp\\.espressif\\tools\\esp32s2ulp-elf\\2.28.51-esp-20191205\\esp32s2ulp-elf-binutils\\bin;C:\\dev\\esp\\.espressif\\tools\\cmake\\3.16.4\\bin;C:\\dev\\esp\\.espressif\\tools\\openocd-esp32\\v0.10.0-esp32-20210401\\openocd-esp32\\bin;C:\\dev\\esp\\.espressif\\tools\\ninja\\1.10.2;C:\\dev\\esp\\.espressif\\tools\\idf-exe\\1.0.1;C:\\dev\\esp\\.espressif\\tools\\ccache\\3.7;C:\\dev\\esp\\.espressif\\tools\\dfu-util\\0.9\\dfu-util-0.9-win64",
    "idf.customExtraVars": "{\"OPENOCD_SCRIPTS\":\"C:\\\\dev\\\\esp\\\\.espressif\\\\tools\\\\openocd-esp32\\\\v0.10.0-esp32-20210401/openocd-esp32/share/openocd/scripts\",\"IDF_CCACHE_ENABLE\":\"1\"}",
>>>>>>> c1a511a (updating)
=======
    "idf.adapterTargetName": "esp32"
>>>>>>> 0bb4d89 (not working, feeder service in progress)
}
```