跳到主內容

【Git】還原相關

  • 還原單一檔案

[webmaster@aaa]$ git pull
Updating d3d5b1a..e39fcb4
error: Your local changes to the following files would be overwritten by merge:
	shell/env/sync_public_data.sh
Please, commit your changes or stash them before you can merge.
Aborting
[webmaster@aaa]$ git reset -- shell/env/sync_public_data.sh
  • 還原至上次commit

git reset --hard
git pull