Getting Git requires very specific steps to throw out the information, and even then it does not overwrite the information. Thus, the situation may not be what you think.
Think of the Git repository as a transactional database of your source code. Depending on your settings and settings, this may be a hidden database, so all you see is a working directory.
The fact is that Git uses this working directory in the local file system as a browser in the database. This “opinion” may change, and the record of all your transactions (commits) is still in the repo, unchanged.
Thus, the working directory that you see will change according to what you called (see, as a rule, a branch). Even copies of files that open in a text editor can change, which really disgusted me the first time I noticed it.
You can throw away the previous work, for example:
1. git reset HEAD~2 , which discards your last two commits or
2. checkout -f , which discards unmanaged changes in your working directory (irrevocably if they were not git add ed) before moving to another branch ('view')
but you cannot inadvertently rewrite information without receiving at least a warning. In most cases, the information is still in the repo until garbage is collected, usually after more than 30 days.
As Greg said, we need more information to know for sure.
source share