Custom field and bench update


I’ve followed the tutorial here :

I’ve added a custom field “tax-id” to sales_invoice doc.
Now when I run bench update I get

error: Your local changes to the following files would be overwritten by merge:

what I did with the help of some discussions found here:

cd /frappe-bench/apps/erpnext
git stash
cd ../../
bench update

update worked but I have lost my custom field and data in all my invoices.

what should I do if I want my custom fields not to disapear in the next update?

so far, I’ve read somewhere I should create a custom app. Do I have to do that with erpnext v7?
I’m not sure I can do that without a step by step guide. Can you help?

When you git stash the modifications you made are saved and the repo goes back to the original state.
You can apply your stashed changes later (after bench update). Feel free to Google about git stash.

what I’m supposed to do then? git stash apply?
here is what I get

git stash apply
erpnext/accounts/doctype/sales_invoice/sales_invoice.json: needs merge
unable to refresh index

After you have done git stash initially and ran the bench update you can also use git stash pop to apply changes and remove them from the stack

Check with git status, if there are changes, if yes, git add them and then do your commit.