diff --git a/buildroot/share/git/mfpub b/buildroot/share/git/mfpub
index 162405391998b7034690cc4a129652ebb17c58b7..6885216a0bbe17e30cef1de986604086bf080ea4 100755
--- a/buildroot/share/git/mfpub
+++ b/buildroot/share/git/mfpub
@@ -110,7 +110,7 @@ git reset --hard
 git clean -d -f
 
 # Copy built-site into the gh-pages branch
-git checkout gh-pages
+git checkout gh-pages || { echo "Something went wrong!"; exit 1; }
 rsync -av ${TMPFOLDER}/ ./
 
 # Commit and push the new live site directly