diff --git a/CHANGES b/CHANGES
index 8b4b3aa..6e67ea0 100644
--- a/CHANGES
+++ b/CHANGES
@@ -32,6 +32,8 @@ Pint Changelog
 - Fix typo in docs for wraps example with optional arguments. (Issue #1088)
 - Add momentum as a dimension
 - Fixed a bug where unit exponents were only partially superscripted in HTML format
+- Multiple contexts containing the same redefinition can now be stacked
+  (Issue #1108, Thanks Guido Imperiale)
 
 
 0.12 (2020-05-29)
diff --git a/pint/registry.py b/pint/registry.py
index 84544e1..ed6bb1d 100644
--- a/pint/registry.py
+++ b/pint/registry.py
@@ -1546,7 +1546,7 @@ class ContextRegistry(BaseRegistry):
         on_redefinition_backup = self._on_redefinition
         self._on_redefinition = "ignore"
         try:
-            for ctx in self._active_ctx.contexts:
+            for ctx in reversed(self._active_ctx.contexts):
                 for definition in ctx.redefinitions:
                     self._redefine(definition)
         finally:

Context redefinitions can't be overlayed
When multiple contexts are active and more than one redefines the same unit, pint incorrectly picks up the first redefinition instead of the latest:

```python
ureg = pint.UnitRegistry()
c1 = pint.Context.from_lines(["@context a", "lb = 0.5 kg"])
c2 = pint.Context.from_lines(["@context b", "lb = 0.7 kg"])
one_src = ureg.Quantity(1, "kg")
print(one_src.to("lb"))
ureg.enable_contexts(c1)
print(one_src.to("lb"))
ureg.enable_contexts(c2)
print(one_src.to("lb"))
```
Expected output:
```
2.2046226218487757 pound
2.0 pound
1.4285714285714286 pound
```
Actual output:
```
2.2046226218487757 pound
2.0 pound
2.0 pound
```

Inter-dimensional transforms instead work as expected:
```python
ureg = pint.UnitRegistry()
c1 = pint.Context.from_lines(["@context a", "[volume] -> [mass]: value * 1 kg/l"])
c2 = pint.Context.from_lines(["@context b", "[volume] -> [mass]: value * 2 kg/l"])
one_src = ureg.Quantity(1, "l")
ureg.enable_contexts(c1)
print(one_src.to("kg"))
ureg.enable_contexts(c2)
print(one_src.to("kg"))
```
Output:
```
1.0 kilogram
2.0 kilogram
```
diff --git a/pint/testsuite/test_contexts.py b/pint/testsuite/test_contexts.py
index bc575ed..b57a4df 100644
--- a/pint/testsuite/test_contexts.py
+++ b/pint/testsuite/test_contexts.py
@@ -835,6 +835,38 @@ class TestContextRedefinitions(QuantityTestCase):
             with ureg.context("mult_to_nonmult"):
                 self.assertAlmostEqual(k.to("bogodegrees").magnitude, (100 - 123) / 5)
 
+    def test_stack_contexts(self):
+        ureg = UnitRegistry(
+            """
+            a = [dim1]
+            b = 1/2 a
+            c = 1/3 a
+            d = [dim2]
+
+            @context c1
+                b = 1/4 a
+                c = 1/6 a
+                [dim1]->[dim2]: value * 2 d/a
+            @end
+            @context c2
+                b = 1/5 a
+                [dim1]->[dim2]: value * 3 d/a
+            @end
+            """.splitlines()
+        )
+        q = ureg.Quantity(1, "a")
+        assert q.to("b").magnitude == 2
+        assert q.to("c").magnitude == 3
+        assert q.to("b", "c1").magnitude == 4
+        assert q.to("c", "c1").magnitude == 6
+        assert q.to("d", "c1").magnitude == 2
+        assert q.to("b", "c2").magnitude == 5
+        assert q.to("c", "c2").magnitude == 3
+        assert q.to("d", "c2").magnitude == 3
+        assert q.to("b", "c1", "c2").magnitude == 5  # c2 takes precedence
+        assert q.to("c", "c1", "c2").magnitude == 6  # c2 doesn't change it, so use c1
+        assert q.to("d", "c1", "c2").magnitude == 3  # c2 takes precedence
+
     def test_err_to_base_unit(self):
         with self.assertRaises(DefinitionSyntaxError) as e:
             Context.from_lines(["@context c", "x = [d]"])

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
exceptiongroup==1.2.2
iniconfig==2.1.0
packaging==24.2
-e git+https://github.com/hgrecco/pint.git@af723faccff4d4778dd21cafc71de78b015b91c3#egg=Pint
pluggy==1.5.0
pytest==8.3.5
pytest-cov==6.0.0
tomli==2.2.1

name: pint
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - exceptiongroup==1.2.2
      - iniconfig==2.1.0
      - packaging==24.2
      - pint==0.13.dev93+gaf723fa
      - pluggy==1.5.0
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - tomli==2.2.1
prefix: /opt/conda/envs/pint

pint/testsuite/test_contexts.py::TestContextRedefinitions::test_stack_contexts
pint/testsuite/test_contexts.py::TestContexts::test_anonymous_context pint/testsuite/test_contexts.py::TestContexts::test_context_with_arg pint/testsuite/test_contexts.py::TestContexts::test_context_with_arg_def pint/testsuite/test_contexts.py::TestContexts::test_context_with_sharedarg_def pint/testsuite/test_contexts.py::TestContexts::test_enable_context_with_arg pint/testsuite/test_contexts.py::TestContexts::test_graph pint/testsuite/test_contexts.py::TestContexts::test_graph_enable pint/testsuite/test_contexts.py::TestContexts::test_known_context pint/testsuite/test_contexts.py::TestContexts::test_known_context_enable pint/testsuite/test_contexts.py::TestContexts::test_known_nested_context pint/testsuite/test_contexts.py::TestContexts::test_multiple_context pint/testsuite/test_contexts.py::TestContexts::test_nested_context pint/testsuite/test_contexts.py::TestContexts::test_one_context pint/testsuite/test_contexts.py::TestContexts::test_parse_auto_inverse pint/testsuite/test_contexts.py::TestContexts::test_parse_define pint/testsuite/test_contexts.py::TestContexts::test_parse_invalid pint/testsuite/test_contexts.py::TestContexts::test_parse_parameterized pint/testsuite/test_contexts.py::TestContexts::test_parse_simple pint/testsuite/test_contexts.py::TestContexts::test_unknown_context pint/testsuite/test_contexts.py::TestContexts::test_unknown_nested_context pint/testsuite/test_contexts.py::TestContexts::test_warnings pint/testsuite/test_contexts.py::TestDefinedContexts::test_decorator pint/testsuite/test_contexts.py::TestDefinedContexts::test_decorator_composition pint/testsuite/test_contexts.py::TestDefinedContexts::test_defined pint/testsuite/test_contexts.py::TestDefinedContexts::test_spectroscopy pint/testsuite/test_contexts.py::TestDefinedContexts::test_textile pint/testsuite/test_contexts.py::TestContextRedefinitions::test_define_nan pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_change_base_unit pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_change_dimensionality pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_cyclic_dependency pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_dimension_redefinition pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_new_unit pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_prefix_redefinition pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_redefine_alias pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_redefine_with_prefix pint/testsuite/test_contexts.py::TestContextRedefinitions::test_err_to_base_unit pint/testsuite/test_contexts.py::TestContextRedefinitions::test_non_multiplicative pint/testsuite/test_contexts.py::TestContextRedefinitions::test_redefine
CHANGES pint/registry.py
CHANGES pint/registry.py