An error appears when trying to unstage a new file that has never been committed while it has changes that are not staged. More specifically, the error appears if the following actions are taken: change -> stage -> change (do not stage) -> unstage. The error Unable to unstage file: error: the following file has staged content different from both the file and the HEAD:. The problem is that it tries to run git rm --cached instead of git restore --staged
An error appears when trying to unstage a new file that has never been committed while it has changes that are not staged. More specifically, the error appears if the following actions are taken: change -> stage -> change (do not stage) -> unstage. The error
Unable to unstage file: error: the following file has staged content different from both the file and the HEAD:. The problem is that it tries to rungit rm --cachedinstead ofgit restore --staged