As already mentioned by NotPoliticallyCorrect in the comment to your question, the AppendAllLines will only append the list to your current data. Nothing more, nothing less.
In order to add 5,6,7 (to the current data and only applicable to this scenario), you also need to later sort the data. That sorting of the data will arrange the lines accordingly.
var lines = File.ReadAllLines("path");
var _lines = new List<string>(lines);
_lines.Add("5");
_lines.Add("6");
_lines.Add("7");
lines = _lines.ToArray();
Array.Sort(lines);
File.WriteAllLines("path", lines);
That will write the data in sequence. You can consider using LINQ here as well, that will give a better readability for the code, but that would require a bit more tinkering to get the code to work.
One more thing, since the data is of string type, the sorting will be like, "1, 10, 2..." and not like, "1, 2,... 10", to use the later one you need to cast the data to integer and then sort it. For that you should look at,
Convert.ToInt32()
method and use that to convert the list to integers before sorting it.
For an example, please have a look here,
Home | .NET Fiddle[
^]