diff --git a/app/lib/computation/blockchainContext.js b/app/lib/computation/blockchainContext.js
index 87cf93d00daa666eca5ff5565756ff15a01e8cf1..2ad4fb66419d236f0de486874cdfea30c8db312d 100644
--- a/app/lib/computation/blockchainContext.js
+++ b/app/lib/computation/blockchainContext.js
@@ -289,6 +289,10 @@ function BlockchainContext(BlockchainService) {
     // Revert nodes
     yield undoMembersUpdate(blockstamp);
 
+    // Get the money movements to revert in the balance
+    const REVERSE_BALANCE = true
+    const sindexOfBlock = yield dal.sindexDAL.getWrittenOn(blockstamp)
+
     yield dal.bindexDAL.removeBlock(number);
     yield dal.mindexDAL.removeBlock(blockstamp);
     yield dal.iindexDAL.removeBlock(blockstamp);
@@ -296,24 +300,19 @@ function BlockchainContext(BlockchainService) {
     yield dal.sindexDAL.removeBlock(blockstamp);
 
     // Then: normal updates
+    const block = yield dal.getBlockByBlockstampOrNull(blockstamp);
     const previousBlock = yield dal.getBlock(number - 1);
     // Set the block as SIDE block (equivalent to removal from main branch)
     yield dal.blockDAL.setSideBlock(number, previousBlock);
 
-    const REVERSE_BALANCE = true
-    const sindexOfBlock = yield dal.sindexDAL.getWrittenOn(blockstamp)
-
     // Revert the balances variations for this block
     yield that.updateWallets(sindexOfBlock, dal, REVERSE_BALANCE)
 
     // Remove any source created for this block (both Dividend and Transaction).
     yield dal.removeAllSourcesOfBlock(blockstamp);
 
-    const block = yield dal.getBlockByBlockstampOrNull(blockstamp);
-    if (block) {
-      // For some reason the block might not exist (issue #827)
-      yield undoDeleteTransactions(block);
-    }
+    // Restore block's transaction as incoming transactions
+    yield undoDeleteTransactions(block)
   });
 
   const checkIssuer = (block) => co(function*() {
diff --git a/app/lib/dal/sqliteDAL/MetaDAL.js b/app/lib/dal/sqliteDAL/MetaDAL.js
index b90353c54f50dd8a3246428bd8b036c3903527e7..f68d18f9e79ce81f70f837d65104bdffe92d6f4b 100644
--- a/app/lib/dal/sqliteDAL/MetaDAL.js
+++ b/app/lib/dal/sqliteDAL/MetaDAL.js
@@ -282,7 +282,12 @@ function MetaDAL(driver) {
         const updateQuery = 'UPDATE m_index SET chainable_on = ' + (reference.medianTime + conf.msPeriod) + ' WHERE pub = \'' + ms.pub + '\' AND op = \'CREATE\''
         yield mindexDAL.exec(updateQuery)
       }
-    })
+    }),
+
+    // Replay the wallet table feeding, because of a potential bug
+    22: function resetWallets() {
+      return migrations[20]()
+    }
   };
 
   this.init = () => co(function *() {
diff --git a/test/dal/dal.js b/test/dal/dal.js
index e31968f1e53848ef2254f9b8991987434e3076f2..21ca71ed7d9d3a2ca2e04a4eb66c8a2a04855766 100644
--- a/test/dal/dal.js
+++ b/test/dal/dal.js
@@ -103,7 +103,7 @@ describe("DAL", function(){
   it('should have DB version 21', () => co(function *() {
     let version = yield fileDAL.getDBVersion();
     should.exist(version);
-    version.should.equal(22);
+    version.should.equal(23);
   }));
 
   it('should have no peer in a first time', function(){
diff --git a/test/integration/branches_revert_balance.js b/test/integration/branches_revert_balance.js
new file mode 100644
index 0000000000000000000000000000000000000000..79a07f075462a942f05d2a4fe4a8a14247f0b920
--- /dev/null
+++ b/test/integration/branches_revert_balance.js
@@ -0,0 +1,81 @@
+"use strict"
+
+const co        = require('co')
+const should    = require('should')
+const toolbox = require('./tools/toolbox')
+
+describe("Revert balance", () => {
+
+  const now = 1480000000
+  let s1, cat, tac
+
+  const conf = {
+    nbCores: 1,
+    ud0: 100,
+    dt: 1,
+    udTime0: now,
+    sigQty: 1,
+    medianTimeBlocks: 1 // The medianTime always equals previous block's medianTime
+  }
+
+  before(() => co(function*() {
+    const res1 = yield toolbox.simpleNodeWith2Users(conf)
+    s1 = res1.s1
+    cat = res1.cat
+    tac = res1.tac
+    yield s1.commit({ time: now })
+    yield s1.commit({ time: now + 1 })
+    yield s1.commit({ time: now + 1  })
+  }))
+
+  it('cat and tac should have 200 units', () => co(function*() {
+    yield s1.expect('/tx/sources/' + cat.pub, (res) => {
+      res.sources.should.have.length(2)
+    })
+    yield s1.expect('/tx/sources/' + tac.pub, (res) => {
+      res.sources.should.have.length(2)
+    })
+  }))
+
+  it('cat should be able to send 60 units to tac', () => co(function*() {
+    yield cat.send(60, tac)
+    yield s1.commit({ time: now + 1 })
+    yield s1.expect('/tx/sources/' + cat.pub, (res) => {
+      res.sources.should.have.length(2)
+    })
+    yield s1.expect('/tx/sources/' + tac.pub, (res) => {
+      res.sources.should.have.length(3)
+    })
+    const block = yield s1.dal.blockDAL.getBlock(3)
+    block.documentType = 'block'
+    // yield s1.singleWritePromise(block)
+  }))
+
+  it('revert: cat and tac should have 100 units', () => co(function*() {
+    yield s1.revert();
+    yield s1.expect('/tx/sources/' + cat.pub, (res) => {
+      res.sources.should.have.length(2)
+    })
+    yield s1.expect('/tx/sources/' + tac.pub, (res) => {
+      res.sources.should.have.length(2)
+    })
+  }))
+
+  it('cat should be able to RE-send 60 units to tac', () => co(function*() {
+    const txsPending = yield s1.dal.txsDAL.getAllPending(1)
+    txsPending.should.have.length(1)
+    yield s1.commit({ time: now + 1 })
+    yield s1.expect('/tx/sources/' + cat.pub, (res) => {
+      // Should have 2 sources:
+      // * the 2nd UD = 100
+      // * the rest of the 1st UD - the money sent (60) = 40
+      res.sources.should.have.length(2)
+    })
+    yield s1.expect('/tx/sources/' + tac.pub, (res) => {
+      res.sources.should.have.length(3)
+    })
+    const block = yield s1.dal.blockDAL.getBlock(3)
+    block.documentType = 'block'
+    // yield s1.singleWritePromise(block)
+  }))
+})