diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 87a789b..b6bc59b 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -24,6 +24,8 @@ Fixed
   <https://github.com/omni-us/jsonargparse/issues/465>`__).
 - Optional callable that returns a class instance with a lambda default,
   produces an invalid string default.
+- dataclass single parameter change incorrectly resetting previous values (`#464
+  <https://github.com/omni-us/jsonargparse/issues/464>`__).
 
 
 v4.27.5 (2024-02-12)
diff --git a/jsonargparse/_typehints.py b/jsonargparse/_typehints.py
index eb6f050..67ec5eb 100644
--- a/jsonargparse/_typehints.py
+++ b/jsonargparse/_typehints.py
@@ -863,7 +863,8 @@ def adapt_typehints(
         elif isinstance(val, (dict, Namespace)):
             val = parser.parse_object(val, defaults=sub_defaults.get() or list_item)
         elif isinstance(val, NestedArg):
-            val = parser.parse_args([f"--{val.key}={val.val}"])
+            prev_val = prev_val if isinstance(prev_val, Namespace) else None
+            val = parser.parse_args([f"--{val.key}={val.val}"], namespace=prev_val)
         else:
             raise_unexpected_value(f"Type {typehint} expects a dict or Namespace", val)
 

diff --git a/jsonargparse_tests/test_dataclass_like.py b/jsonargparse_tests/test_dataclass_like.py
index df8b431..0402eee 100644
--- a/jsonargparse_tests/test_dataclass_like.py
+++ b/jsonargparse_tests/test_dataclass_like.py
@@ -8,6 +8,7 @@ import pytest
 import yaml
 
 from jsonargparse import (
+    ActionConfigFile,
     ArgumentError,
     ArgumentParser,
     Namespace,
@@ -359,6 +360,20 @@ def test_optional_dataclass_type_null_value():
     assert cfg == parser_optional_data.instantiate_classes(cfg)
 
 
+@dataclasses.dataclass
+class SingleParamChange:
+    p1: int = 0
+    p2: int = 0
+
+
+def test_optional_dataclass_single_param_change(parser):
+    parser.add_argument("--config", action=ActionConfigFile)
+    parser.add_argument("--data", type=Optional[SingleParamChange])
+    config = {"data": {"p1": 1}}
+    cfg = parser.parse_args([f"--config={config}", "--data.p2=2"])
+    assert cfg.data == Namespace(p1=1, p2=2)
+
+
 @dataclasses.dataclass
 class ModelConfig:
     data: Optional[Dict[str, Any]] = None

Overriding a config's argument makes everything else fall back to the base class
## 🐛 Bug report

### To reproduce

`repro.py`:

```python
from dataclasses import dataclass
from typing import Optional

@dataclass
class Thing:
    foo: int = 1
    bar: int = 2

def fn(thing: Optional[Thing] = None):
    thing = Thing() if thing is None else thing
    print(thing)

from jsonargparse import CLI
CLI(fn)
```

`repro.yaml`:

```yaml
thing:
  foo: 123
  bar: 321
```

`python repro.py --config repro.yaml --thing.foo 9`

### Expected behavior

The above prints

```python
Thing(foo=9, bar=2)
```

but I expected

```python
Thing(foo=9, bar=321)
```

### Context

A more real world example is that you have a `trainer_config.yaml` and you want to only modify the `--train.max_epochs` value without having everything else fall back to dataclass defaults

### Environment

Version 4.275

jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_single_param_change
jsonargparse_tests/test_dataclass_like.py::test_add_dataclass_arguments jsonargparse_tests/test_dataclass_like.py::test_add_dataclass_nested_defaults jsonargparse_tests/test_dataclass_like.py::test_add_class_with_dataclass_attributes jsonargparse_tests/test_dataclass_like.py::test_add_class_dataclass_typehint_in_subclass jsonargparse_tests/test_dataclass_like.py::test_add_class_optional_without_default jsonargparse_tests/test_dataclass_like.py::test_add_argument_dataclass_type jsonargparse_tests/test_dataclass_like.py::test_add_argument_dataclass_type_required_attr jsonargparse_tests/test_dataclass_like.py::test_dataclass_field_init_false jsonargparse_tests/test_dataclass_like.py::test_dataclass_field_default_factory jsonargparse_tests/test_dataclass_like.py::test_dataclass_fail_untyped_false jsonargparse_tests/test_dataclass_like.py::test_compose_dataclasses jsonargparse_tests/test_dataclass_like.py::test_instantiate_dataclass_within_classes jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_type_all_fields jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_type_single_field jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_type_invalid_field jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_type_instantiate jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_type_dump jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_type_missing_required_field jsonargparse_tests/test_dataclass_like.py::test_optional_dataclass_type_null_value jsonargparse_tests/test_dataclass_like.py::test_dataclass_optional_dict_attribute jsonargparse_tests/test_dataclass_like.py::test_dataclass_in_union_type jsonargparse_tests/test_dataclass_like.py::test_dataclass_in_list_type jsonargparse_tests/test_dataclass_like.py::test_generic_dataclass jsonargparse_tests/test_dataclass_like.py::test_nested_generic_dataclass jsonargparse_tests/test_dataclass_like.py::test_add_class_final jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_dataclass jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_basemodel jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_subclass jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_field_default_factory jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_field_description jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_annotated_field jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[abc-a-none-constr(min_length=2, jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[2-0-none-conint(ge=1)] jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[-1.0-1.0-none-confloat(lt=0.0)] jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[valid_value3-invalid_value3-none-conlist(int, jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[valid_value4-invalid_value4-none-conlist(int, jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[valid_value5-x-list-conset(int, jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[http://abc.es/---str-HttpUrl] jsonargparse_tests/test_dataclass_like.py::TestPydantic::test_pydantic_types[127.0.0.1-0-str-IPvAnyAddress] jsonargparse_tests/test_dataclass_like.py::TestAttrs::test_define jsonargparse_tests/test_dataclass_like.py::TestAttrs::test_subclass jsonargparse_tests/test_dataclass_like.py::TestAttrs::test_field_factory