I had some unstaged changes in my repo. Output on the terminal:
--- a/app/something.java
+++ b/app/something.java
@@ -37,13 +37,17 @@ public class SomeController extends Controller{
requestVo.setJobName("temp1");
requestVo.setJobGroup("g1");
requestVo.setJobInfo(JobInfo.INFO);
- requestVo.setJobExecutionType(JobExecutionType.IMMEDIATE);
- requestVo.setExecutionTime(new Date());
+ requestVo.setJobExecutionType(JobExecutionType.TIMED);
+ requestVo.setExecutionTime(getExecutionTime(3600*1000l));
requestVo.setJobData("testing 123");
}
+ private Date getExecutionTime(long delay) {
+ return new Date(System.currentTimeMillis() + delay);
+ }
+
...
Then I proceeded to git reset --hard HEAD, so I lost my changes. Is there any way to get back the changes? Or apply my changes from the terminal as a commit?
If you still have the full output of your git diff, as the extract shown in your question suggests, you could try and:
git diff output in a file diff.patch.That is:
git apply save.patch
# or
patch -p1 < save.patch
Note: git apply is preferred here, as git diff outputs a line for file renames, output which patch would ignore.
IF you don't have that full diff output... then previous answers/comments apply.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With