I have again lost my history. Now there is no garbage in files but I couldn't trigger any command pressing CTRL+R. I have checked that file .ash_history is empty. There is also a file .ash_history.1918.new that is empty and a ash_history.3055.new with only 100 very old commands.
trap 'NAME=`date +%Y%m%d_%H%M%S`_bak && \ cp /home/user/.ash_history /home/user/hist_bak/$NAME' 0