Any material cannot be used without our explicit consent for online and offline purposes. Monitoring Linux Processes using Prometheus and Grafana. How To List Disks on Linux. How To Add Route on Linux. How To Encrypt Partition on Linux. How To Encrypt File on Linux. How To List Services on Linux. Software Engineering. Table of Contents. Amit Amit 6 6 silver badges 8 8 bronze badges.
As we see from the output "Already up-to-date", the person asking this question has not committed anything lately. As it might undo local changes that were not commited restoring previous files being the positive outcome, losing changes on edited files the negative one.
Keep in mind that this command will overwrite all your local changes. All the deleted files before the last commit will be recovered. Alexan 7, 13 13 gold badges 71 71 silver badges 92 92 bronze badges. Mona Wade Mona Wade 15 15 bronze badges.
In the code directory: git checkout. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE.
Podcast Who is building clouds for the independent developer? Featured on Meta. Now live: A fully responsive profile. This guide helps you optimize your website for speed and performance. You made a commit deleting a file, but then realized you wanted to keep the file around after all? The file can then be restored as in the previous scenario :. If you deleted a file, committed, then continued work and did more commits, only to find that deleting the file was a mistake, Git still has you covered!
To find the right commit, first check the history for the deleted file:. You can either work with the last commit that still had the file, or the commit that deleted the file. In the first case, just checkout the file from that commit:. In this case, it is probably better to record a new commit which undoes the work of the one deleting the file. To do this, run:. Following this, create your new commit as desired.
0コメント