I am trying to connect a local repository (latest file versions) to a remote (old file versions). I followed these steps:
git init
andgit remote add origin
to connect to the remote.git add
updated file.git commit -m "Message"
.git push origin master
.
The commit was rejected with the message:
error: failed to push some refs to ...
Updates were rejected because the remote contains work that you do not have locally. This is usually caused by another repository pushing to the same ref.
I realize that I need to stash/pull/pop stash as described here.
However, in the meantime, the file I tried to commit has disappeared. When I type git status, I don't see it anywhere. It's still in my local repository, but Git doesn't seem to be tracking it. Any idea how to fix this?